* m68klinux-nat.c: Include "gdb_proc_service.h".
[deliverable/binutils-gdb.git] / bfd / elf-hppa.h
CommitLineData
9e103c9c 1/* Common code for PA ELF implementations.
30d10e9e
AM
2 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
3 2009, 2010
555cd476 4 Free Software Foundation, Inc.
9e103c9c 5
9b52905e 6 This file is part of BFD, the Binary File Descriptor library.
9e103c9c 7
9b52905e
NC
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
cd123cb7 10 the Free Software Foundation; either version 3 of the License, or
9b52905e 11 (at your option) any later version.
9e103c9c 12
9b52905e
NC
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
9e103c9c 17
9b52905e
NC
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
cd123cb7
NC
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
9e103c9c
JL
22
23#define ELF_HOWTO_TABLE_SIZE R_PARISC_UNIMPLEMENTED + 1
24
2eb429af
JL
25/* This file is included by multiple PA ELF BFD backends with different
26 sizes.
27
28 Most of the routines are written to be size independent, but sometimes
29 external constraints require 32 or 64 bit specific code. We remap
30 the definitions/functions as necessary here. */
9e103c9c 31#if ARCH_SIZE == 64
9b52905e
NC
32#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
33#define ELF_R_SYM(X) ELF64_R_SYM(X)
34#define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type
35#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
36#define elf_hppa_relocate_section elf64_hppa_relocate_section
37#define elf_hppa_final_link elf64_hppa_final_link
9e103c9c
JL
38#endif
39#if ARCH_SIZE == 32
9b52905e
NC
40#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
41#define ELF_R_SYM(X) ELF32_R_SYM(X)
42#define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type
43#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
44#define elf_hppa_relocate_section elf32_hppa_relocate_section
45#define elf_hppa_final_link elf32_hppa_final_link
3f9b03b5
AM
46#endif
47
9e103c9c
JL
48/* ELF/PA relocation howto entries. */
49
50static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
51{
b34976b6
AM
52 { R_PARISC_NONE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
53 bfd_elf_generic_reloc, "R_PARISC_NONE", FALSE, 0, 0, FALSE },
9e103c9c
JL
54
55 /* The values in DIR32 are to placate the check in
56 _bfd_stab_section_find_nearest_line. */
b34976b6
AM
57 { R_PARISC_DIR32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
58 bfd_elf_generic_reloc, "R_PARISC_DIR32", FALSE, 0, 0xffffffff, FALSE },
ab96bf03 59 { R_PARISC_DIR21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6 60 bfd_elf_generic_reloc, "R_PARISC_DIR21L", FALSE, 0, 0, FALSE },
ab96bf03 61 { R_PARISC_DIR17R, 0, 2, 17, FALSE, 0, complain_overflow_bitfield,
b34976b6 62 bfd_elf_generic_reloc, "R_PARISC_DIR17R", FALSE, 0, 0, FALSE },
ab96bf03 63 { R_PARISC_DIR17F, 0, 2, 17, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
64 bfd_elf_generic_reloc, "R_PARISC_DIR17F", FALSE, 0, 0, FALSE },
65 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
66 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 67 { R_PARISC_DIR14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 68 bfd_elf_generic_reloc, "R_PARISC_DIR14R", FALSE, 0, 0, FALSE },
ab96bf03 69 { R_PARISC_DIR14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 70 bfd_elf_generic_reloc, "R_PARISC_DIR14F", FALSE, 0, 0, FALSE },
49bd834c 71 /* 8 */
ab96bf03 72 { R_PARISC_PCREL12F, 0, 2, 12, TRUE, 0, complain_overflow_bitfield,
b34976b6 73 bfd_elf_generic_reloc, "R_PARISC_PCREL12F", FALSE, 0, 0, FALSE },
ab96bf03 74 { R_PARISC_PCREL32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
b34976b6 75 bfd_elf_generic_reloc, "R_PARISC_PCREL32", FALSE, 0, 0, FALSE },
ab96bf03 76 { R_PARISC_PCREL21L, 0, 2, 21, TRUE, 0, complain_overflow_bitfield,
b34976b6 77 bfd_elf_generic_reloc, "R_PARISC_PCREL21L", FALSE, 0, 0, FALSE },
ab96bf03 78 { R_PARISC_PCREL17R, 0, 2, 17, TRUE, 0, complain_overflow_bitfield,
b34976b6 79 bfd_elf_generic_reloc, "R_PARISC_PCREL17R", FALSE, 0, 0, FALSE },
ab96bf03 80 { R_PARISC_PCREL17F, 0, 2, 17, TRUE, 0, complain_overflow_bitfield,
b34976b6 81 bfd_elf_generic_reloc, "R_PARISC_PCREL17F", FALSE, 0, 0, FALSE },
ab96bf03 82 { R_PARISC_PCREL17C, 0, 2, 17, TRUE, 0, complain_overflow_bitfield,
b34976b6 83 bfd_elf_generic_reloc, "R_PARISC_PCREL17C", FALSE, 0, 0, FALSE },
ab96bf03 84 { R_PARISC_PCREL14R, 0, 2, 14, TRUE, 0, complain_overflow_bitfield,
b34976b6 85 bfd_elf_generic_reloc, "R_PARISC_PCREL14R", FALSE, 0, 0, FALSE },
ab96bf03 86 { R_PARISC_PCREL14F, 0, 2, 14, TRUE, 0, complain_overflow_bitfield,
b34976b6 87 bfd_elf_generic_reloc, "R_PARISC_PCREL14F", FALSE, 0, 0, FALSE },
49bd834c 88 /* 16 */
b34976b6
AM
89 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
90 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
91 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
92 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 93 { R_PARISC_DPREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6 94 bfd_elf_generic_reloc, "R_PARISC_DPREL21L", FALSE, 0, 0, FALSE },
ab96bf03 95 { R_PARISC_DPREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 96 bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", FALSE, 0, 0, FALSE },
ab96bf03 97 { R_PARISC_DPREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
98 bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", FALSE, 0, 0, FALSE },
99 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
100 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 101 { R_PARISC_DPREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 102 bfd_elf_generic_reloc, "R_PARISC_DPREL14R", FALSE, 0, 0, FALSE },
ab96bf03 103 { R_PARISC_DPREL14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 104 bfd_elf_generic_reloc, "R_PARISC_DPREL14F", FALSE, 0, 0, FALSE },
49bd834c 105 /* 24 */
b34976b6
AM
106 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
107 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
108 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
109 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 110 { R_PARISC_DLTREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
111 bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", FALSE, 0, 0, FALSE },
112 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
113 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
114 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
115 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
116 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
117 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 118 { R_PARISC_DLTREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 119 bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", FALSE, 0, 0, FALSE },
ab96bf03 120 { R_PARISC_DLTREL14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 121 bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", FALSE, 0, 0, FALSE },
49bd834c 122 /* 32 */
b34976b6
AM
123 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
124 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
125 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
126 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 127 { R_PARISC_DLTIND21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
128 bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", FALSE, 0, 0, FALSE },
129 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
130 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
131 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
132 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
133 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
134 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 135 { R_PARISC_DLTIND14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 136 bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", FALSE, 0, 0, FALSE },
ab96bf03 137 { R_PARISC_DLTIND14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 138 bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", FALSE, 0, 0, FALSE },
49bd834c 139 /* 40 */
b34976b6
AM
140 { R_PARISC_SETBASE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
141 bfd_elf_generic_reloc, "R_PARISC_SETBASE", FALSE, 0, 0, FALSE },
ab96bf03
AM
142 { R_PARISC_SECREL32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
143 bfd_elf_generic_reloc, "R_PARISC_SECREL32", FALSE, 0, 0xffffffff, FALSE },
144 { R_PARISC_BASEREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6 145 bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", FALSE, 0, 0, FALSE },
ab96bf03 146 { R_PARISC_BASEREL17R, 0, 2, 17, FALSE, 0, complain_overflow_bitfield,
b34976b6 147 bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", FALSE, 0, 0, FALSE },
ab96bf03 148 { R_PARISC_BASEREL17F, 0, 2, 17, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
149 bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", FALSE, 0, 0, FALSE },
150 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
151 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 152 { R_PARISC_BASEREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 153 bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", FALSE, 0, 0, FALSE },
ab96bf03 154 { R_PARISC_BASEREL14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 155 bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", FALSE, 0, 0, FALSE },
49bd834c 156 /* 48 */
b34976b6
AM
157 { R_PARISC_SEGBASE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
158 bfd_elf_generic_reloc, "R_PARISC_SEGBASE", FALSE, 0, 0, FALSE },
ab96bf03 159 { R_PARISC_SEGREL32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
b34976b6 160 bfd_elf_generic_reloc, "R_PARISC_SEGREL32", FALSE, 0, 0, FALSE },
ab96bf03 161 { R_PARISC_PLTOFF21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
162 bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", FALSE, 0, 0, FALSE },
163 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
164 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
165 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
166 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
167 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
168 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 169 { R_PARISC_PLTOFF14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 170 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", FALSE, 0, 0, FALSE },
ab96bf03 171 { R_PARISC_PLTOFF14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 172 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", FALSE, 0, 0, FALSE },
49bd834c 173 /* 56 */
b34976b6
AM
174 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
175 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 176 { R_PARISC_LTOFF_FPTR32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
b34976b6 177 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", FALSE, 0, 0, FALSE },
ab96bf03 178 { R_PARISC_LTOFF_FPTR21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
179 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", FALSE, 0, 0, FALSE },
180 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
181 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
182 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
183 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
184 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
185 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 186 { R_PARISC_LTOFF_FPTR14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
187 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", FALSE, 0, 0, FALSE },
188 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
189 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 190 /* 64 */
ab96bf03 191 { R_PARISC_FPTR64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6 192 bfd_elf_generic_reloc, "R_PARISC_FPTR64", FALSE, 0, 0, FALSE },
ab96bf03 193 { R_PARISC_PLABEL32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
b34976b6 194 bfd_elf_generic_reloc, "R_PARISC_PLABEL32", FALSE, 0, 0, FALSE },
ab96bf03 195 { R_PARISC_PLABEL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
196 bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", FALSE, 0, 0, FALSE },
197 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
198 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
199 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
200 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
201 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
202 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 203 { R_PARISC_PLABEL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
204 bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", FALSE, 0, 0, FALSE },
205 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
206 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 207 /* 72 */
ab96bf03 208 { R_PARISC_PCREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6 209 bfd_elf_generic_reloc, "R_PARISC_PCREL64", FALSE, 0, 0, FALSE },
ab96bf03 210 { R_PARISC_PCREL22C, 0, 2, 22, FALSE, 0, complain_overflow_bitfield,
b34976b6 211 bfd_elf_generic_reloc, "R_PARISC_PCREL22C", FALSE, 0, 0, FALSE },
ab96bf03 212 { R_PARISC_PCREL22F, 0, 2, 22, FALSE, 0, complain_overflow_bitfield,
b34976b6 213 bfd_elf_generic_reloc, "R_PARISC_PCREL22F", FALSE, 0, 0, FALSE },
ab96bf03 214 { R_PARISC_PCREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 215 bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", FALSE, 0, 0, FALSE },
ab96bf03 216 { R_PARISC_PCREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 217 bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", FALSE, 0, 0, FALSE },
ab96bf03 218 { R_PARISC_PCREL16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 219 bfd_elf_generic_reloc, "R_PARISC_PCREL16F", FALSE, 0, 0, FALSE },
ab96bf03 220 { R_PARISC_PCREL16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 221 bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", FALSE, 0, 0, FALSE },
ab96bf03 222 { R_PARISC_PCREL16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 223 bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", FALSE, 0, 0, FALSE },
49bd834c 224 /* 80 */
ab96bf03 225 { R_PARISC_DIR64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
226 bfd_elf_generic_reloc, "R_PARISC_DIR64", FALSE, 0, 0, FALSE },
227 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
228 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
229 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
230 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 231 { R_PARISC_DIR14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 232 bfd_elf_generic_reloc, "R_PARISC_DIR14WR", FALSE, 0, 0, FALSE },
ab96bf03 233 { R_PARISC_DIR14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 234 bfd_elf_generic_reloc, "R_PARISC_DIR14DR", FALSE, 0, 0, FALSE },
ab96bf03 235 { R_PARISC_DIR16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 236 bfd_elf_generic_reloc, "R_PARISC_DIR16F", FALSE, 0, 0, FALSE },
ab96bf03 237 { R_PARISC_DIR16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 238 bfd_elf_generic_reloc, "R_PARISC_DIR16WF", FALSE, 0, 0, FALSE },
ab96bf03 239 { R_PARISC_DIR16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 240 bfd_elf_generic_reloc, "R_PARISC_DIR16DF", FALSE, 0, 0, FALSE },
49bd834c 241 /* 88 */
ab96bf03 242 { R_PARISC_GPREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
243 bfd_elf_generic_reloc, "R_PARISC_GPREL64", FALSE, 0, 0, FALSE },
244 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
245 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
246 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
247 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 248 { R_PARISC_DLTREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 249 bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", FALSE, 0, 0, FALSE },
ab96bf03 250 { R_PARISC_DLTREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 251 bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", FALSE, 0, 0, FALSE },
ab96bf03 252 { R_PARISC_GPREL16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 253 bfd_elf_generic_reloc, "R_PARISC_GPREL16F", FALSE, 0, 0, FALSE },
ab96bf03 254 { R_PARISC_GPREL16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 255 bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", FALSE, 0, 0, FALSE },
ab96bf03 256 { R_PARISC_GPREL16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 257 bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", FALSE, 0, 0, FALSE },
49bd834c 258 /* 96 */
ab96bf03 259 { R_PARISC_LTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
260 bfd_elf_generic_reloc, "R_PARISC_LTOFF64", FALSE, 0, 0, FALSE },
261 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
262 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
263 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
264 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 265 { R_PARISC_DLTIND14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 266 bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", FALSE, 0, 0, FALSE },
ab96bf03 267 { R_PARISC_DLTIND14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 268 bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", FALSE, 0, 0, FALSE },
ab96bf03 269 { R_PARISC_LTOFF16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 270 bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", FALSE, 0, 0, FALSE },
ab96bf03 271 { R_PARISC_LTOFF16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 272 bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", FALSE, 0, 0, FALSE },
ab96bf03 273 { R_PARISC_LTOFF16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 274 bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", FALSE, 0, 0, FALSE },
49bd834c 275 /* 104 */
b34976b6
AM
276 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
277 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
278 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
279 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 280 { R_PARISC_BASEREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 281 bfd_elf_generic_reloc, "R_PARISC_BASEREL14WR", FALSE, 0, 0, FALSE },
ab96bf03 282 { R_PARISC_BASEREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
283 bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", FALSE, 0, 0, FALSE },
284 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
285 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
286 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
287 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
288 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
289 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
290 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
291 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 292 /* 112 */
ab96bf03 293 { R_PARISC_SEGREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
294 bfd_elf_generic_reloc, "R_PARISC_SEGREL64", FALSE, 0, 0, FALSE },
295 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
296 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
297 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
298 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 299 { R_PARISC_PLTOFF14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 300 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", FALSE, 0, 0, FALSE },
ab96bf03 301 { R_PARISC_PLTOFF14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 302 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", FALSE, 0, 0, FALSE },
ab96bf03 303 { R_PARISC_PLTOFF16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 304 bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", FALSE, 0, 0, FALSE },
ab96bf03 305 { R_PARISC_PLTOFF16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 306 bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", FALSE, 0, 0, FALSE },
ab96bf03 307 { R_PARISC_PLTOFF16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 308 bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", FALSE, 0, 0, FALSE },
49bd834c 309 /* 120 */
ab96bf03 310 { R_PARISC_LTOFF_FPTR64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
311 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
312 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
313 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
314 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
315 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 316 { R_PARISC_LTOFF_FPTR14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 317 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", FALSE, 0, 0, FALSE },
ab96bf03 318 { R_PARISC_LTOFF_FPTR14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 319 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", FALSE, 0, 0, FALSE },
ab96bf03 320 { R_PARISC_LTOFF_FPTR16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 321 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", FALSE, 0, 0, FALSE },
ab96bf03 322 { R_PARISC_LTOFF_FPTR16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 323 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", FALSE, 0, 0, FALSE },
ab96bf03 324 { R_PARISC_LTOFF_FPTR16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 325 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 326 /* 128 */
b34976b6
AM
327 { R_PARISC_COPY, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
328 bfd_elf_generic_reloc, "R_PARISC_COPY", FALSE, 0, 0, FALSE },
329 { R_PARISC_IPLT, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
330 bfd_elf_generic_reloc, "R_PARISC_IPLT", FALSE, 0, 0, FALSE },
331 { R_PARISC_EPLT, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
332 bfd_elf_generic_reloc, "R_PARISC_EPLT", FALSE, 0, 0, FALSE },
333 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
334 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
335 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
336 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
337 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
338 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
339 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
340 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
341 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
342 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 343 /* 136 */
b34976b6
AM
344 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
345 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
346 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
347 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
348 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
349 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
350 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
351 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
352 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
353 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
354 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
355 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
356 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
357 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
358 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
359 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 360 /* 144 */
b34976b6
AM
361 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
362 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
363 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
364 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
365 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
366 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
367 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
368 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
369 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
370 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
371 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
372 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
373 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
374 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
375 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
376 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 377 /* 152 */
b34976b6
AM
378 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
379 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 380 { R_PARISC_TPREL32, 0, 2, 32, FALSE, 0, complain_overflow_dont,
b34976b6 381 bfd_elf_generic_reloc, "R_PARISC_TPREL32", FALSE, 0, 0, FALSE },
ab96bf03 382 { R_PARISC_TPREL21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
383 bfd_elf_generic_reloc, "R_PARISC_TPREL21L", FALSE, 0, 0, FALSE },
384 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
385 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
386 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
387 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
388 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
389 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 390 { R_PARISC_TPREL14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
391 bfd_elf_generic_reloc, "R_PARISC_TPREL14R", FALSE, 0, 0, FALSE },
392 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
393 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 394 /* 160 */
b34976b6
AM
395 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
396 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
397 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
398 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 399 { R_PARISC_LTOFF_TP21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
400 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", FALSE, 0, 0, FALSE },
401 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
402 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
403 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
404 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
405 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
406 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 407 { R_PARISC_LTOFF_TP14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
9b52905e 408 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14R", FALSE, 0, 0, FALSE },
ab96bf03 409 { R_PARISC_LTOFF_TP14F, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 410 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", FALSE, 0, 0, FALSE },
49bd834c 411 /* 168 */
b34976b6
AM
412 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
413 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
414 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
415 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
416 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
417 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
418 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
419 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
420 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
421 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
422 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
423 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
424 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
425 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
426 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
427 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 428 /* 176 */
b34976b6
AM
429 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
430 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
431 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
432 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
433 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
434 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
435 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
436 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
437 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
438 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
439 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
440 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
441 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
442 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
443 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
444 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 445 /* 184 */
b34976b6
AM
446 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
447 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
448 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
449 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
450 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
451 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
452 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
453 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
454 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
455 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
456 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
457 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
458 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
459 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
460 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
461 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 462 /* 192 */
b34976b6
AM
463 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
464 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
465 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
466 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
467 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
468 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
469 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
470 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
471 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
472 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
473 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
474 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
475 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
476 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
477 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
478 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 479 /* 200 */
b34976b6
AM
480 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
481 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
482 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
483 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
484 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
485 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
486 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
487 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
488 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
489 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
490 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
491 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
492 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
493 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
494 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
495 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 496 /* 208 */
b34976b6
AM
497 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
498 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
499 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
500 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
501 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
502 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
503 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
504 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
505 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_dont,
506 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
507 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
508 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
509 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
510 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
511 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
512 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
49bd834c 513 /* 216 */
ab96bf03 514 { R_PARISC_TPREL64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
515 bfd_elf_generic_reloc, "R_PARISC_TPREL64", FALSE, 0, 0, FALSE },
516 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
517 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
518 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
519 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 520 { R_PARISC_TPREL14WR, 0, 2, 14, FALSE, 0, complain_overflow_dont,
b34976b6 521 bfd_elf_generic_reloc, "R_PARISC_TPREL14WR", FALSE, 0, 0, FALSE },
ab96bf03 522 { R_PARISC_TPREL14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 523 bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", FALSE, 0, 0, FALSE },
ab96bf03 524 { R_PARISC_TPREL16F, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 525 bfd_elf_generic_reloc, "R_PARISC_TPREL16F", FALSE, 0, 0, FALSE },
ab96bf03 526 { R_PARISC_TPREL16WF, 0, 2, 16, FALSE, 0, complain_overflow_dont,
b34976b6 527 bfd_elf_generic_reloc, "R_PARISC_TPREL16WF", FALSE, 0, 0, FALSE },
ab96bf03 528 { R_PARISC_TPREL16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 529 bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", FALSE, 0, 0, FALSE },
49bd834c 530 /* 224 */
ab96bf03 531 { R_PARISC_LTOFF_TP64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
b34976b6
AM
532 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", FALSE, 0, 0, FALSE },
533 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
534 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
535 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
536 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", FALSE, 0, 0, FALSE },
ab96bf03 537 { R_PARISC_LTOFF_TP14WR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 538 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", FALSE, 0, 0, FALSE },
ab96bf03 539 { R_PARISC_LTOFF_TP14DR, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
b34976b6 540 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", FALSE, 0, 0, FALSE },
ab96bf03 541 { R_PARISC_LTOFF_TP16F, 0, 2, 16, FALSE, 0, complain_overflow_dont,
b34976b6 542 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16F", FALSE, 0, 0, FALSE },
ab96bf03 543 { R_PARISC_LTOFF_TP16WF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 544 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", FALSE, 0, 0, FALSE },
ab96bf03 545 { R_PARISC_LTOFF_TP16DF, 0, 2, 16, FALSE, 0, complain_overflow_bitfield,
b34976b6 546 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", FALSE, 0, 0, FALSE },
49bd834c 547 /* 232 */
b34976b6
AM
548 { R_PARISC_GNU_VTENTRY, 0, 0, 0, FALSE, 0, complain_overflow_dont,
549 bfd_elf_generic_reloc, "R_PARISC_GNU_VTENTRY", FALSE, 0, 0, FALSE },
550 { R_PARISC_GNU_VTINHERIT, 0, 0, 0, FALSE, 0, complain_overflow_dont,
551 bfd_elf_generic_reloc, "R_PARISC_GNU_VTINHERIT", FALSE, 0, 0, FALSE },
ab96bf03 552 { R_PARISC_TLS_GD21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
9b52905e 553 bfd_elf_generic_reloc, "R_PARISC_TLS_GD21L", FALSE, 0, 0, FALSE },
ab96bf03 554 { R_PARISC_TLS_GD14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
9b52905e
NC
555 bfd_elf_generic_reloc, "R_PARISC_TLS_GD14R", FALSE, 0, 0, FALSE },
556 { R_PARISC_TLS_GDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont,
557 bfd_elf_generic_reloc, "R_PARISC_TLS_GDCALL", FALSE, 0, 0, FALSE },
ab96bf03 558 { R_PARISC_TLS_LDM21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
9b52905e 559 bfd_elf_generic_reloc, "R_PARISC_TLS_LDM21L", FALSE, 0, 0, FALSE },
ab96bf03 560 { R_PARISC_TLS_LDM14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
9b52905e
NC
561 bfd_elf_generic_reloc, "R_PARISC_TLS_LDM14R", FALSE, 0, 0, FALSE },
562 { R_PARISC_TLS_LDMCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont,
563 bfd_elf_generic_reloc, "R_PARISC_TLS_LDMCALL", FALSE, 0, 0, FALSE },
564 /* 240 */
ab96bf03 565 { R_PARISC_TLS_LDO21L, 0, 2, 21, FALSE, 0, complain_overflow_bitfield,
9b52905e 566 bfd_elf_generic_reloc, "R_PARISC_TLS_LDO21L", FALSE, 0, 0, FALSE },
ab96bf03 567 { R_PARISC_TLS_LDO14R, 0, 2, 14, FALSE, 0, complain_overflow_bitfield,
9b52905e 568 bfd_elf_generic_reloc, "R_PARISC_TLS_LDO14R", FALSE, 0, 0, FALSE },
ab96bf03 569 { R_PARISC_TLS_DTPMOD32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
9b52905e 570 bfd_elf_generic_reloc, "R_PARISC_TLS_DTPMOD32", FALSE, 0, 0, FALSE },
ab96bf03 571 { R_PARISC_TLS_DTPMOD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
9b52905e 572 bfd_elf_generic_reloc, "R_PARISC_TLS_DTPMOD64", FALSE, 0, 0, FALSE },
ab96bf03 573 { R_PARISC_TLS_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
9b52905e 574 bfd_elf_generic_reloc, "R_PARISC_TLS_DTPOFF32", FALSE, 0, 0, FALSE },
ab96bf03 575 { R_PARISC_TLS_DTPOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
9b52905e 576 bfd_elf_generic_reloc, "R_PARISC_TLS_DTPOFF64", FALSE, 0, 0, FALSE },
9e103c9c
JL
577};
578
6e2bf930
JL
579#define OFFSET_14R_FROM_21L 4
580#define OFFSET_14F_FROM_21L 5
581
189c6563
AM
582/* Return the final relocation type for the given base type, instruction
583 format, and field selector. */
9e103c9c 584
189c6563 585elf_hppa_reloc_type
c39a58e6
AM
586elf_hppa_reloc_final_type (bfd *abfd,
587 elf_hppa_reloc_type base_type,
588 int format,
589 unsigned int field)
9e103c9c 590{
189c6563 591 elf_hppa_reloc_type final_type = base_type;
9e103c9c
JL
592
593 /* Just a tangle of nested switch statements to deal with the braindamage
594 that a different field selector means a completely different relocation
595 for PA ELF. */
596 switch (base_type)
597 {
9b52905e
NC
598 /* We have been using generic relocation types. However, that may not
599 really make sense. Anyway, we need to support both R_PARISC_DIR64
600 and R_PARISC_DIR32 here. */
0d571602
JL
601 case R_PARISC_DIR32:
602 case R_PARISC_DIR64:
9e103c9c
JL
603 case R_HPPA_ABS_CALL:
604 switch (format)
605 {
606 case 14:
607 switch (field)
608 {
47d89dba
AM
609 case e_fsel:
610 final_type = R_PARISC_DIR14F;
611 break;
9e103c9c
JL
612 case e_rsel:
613 case e_rrsel:
47d89dba 614 case e_rdsel:
9e103c9c
JL
615 final_type = R_PARISC_DIR14R;
616 break;
617 case e_rtsel:
f31cedf7 618 final_type = R_PARISC_DLTIND14R;
9e103c9c 619 break;
36860900
JL
620 case e_rtpsel:
621 final_type = R_PARISC_LTOFF_FPTR14DR;
622 break;
9e103c9c 623 case e_tsel:
f31cedf7 624 final_type = R_PARISC_DLTIND14F;
9e103c9c
JL
625 break;
626 case e_rpsel:
627 final_type = R_PARISC_PLABEL14R;
628 break;
629 default:
189c6563 630 return R_PARISC_NONE;
9e103c9c
JL
631 }
632 break;
633
634 case 17:
635 switch (field)
636 {
637 case e_fsel:
638 final_type = R_PARISC_DIR17F;
639 break;
640 case e_rsel:
641 case e_rrsel:
47d89dba 642 case e_rdsel:
9e103c9c
JL
643 final_type = R_PARISC_DIR17R;
644 break;
645 default:
189c6563 646 return R_PARISC_NONE;
9e103c9c
JL
647 }
648 break;
649
650 case 21:
651 switch (field)
652 {
653 case e_lsel:
654 case e_lrsel:
47d89dba 655 case e_ldsel:
edd21aca
AM
656 case e_nlsel:
657 case e_nlrsel:
9e103c9c
JL
658 final_type = R_PARISC_DIR21L;
659 break;
660 case e_ltsel:
f31cedf7 661 final_type = R_PARISC_DLTIND21L;
9e103c9c 662 break;
36860900
JL
663 case e_ltpsel:
664 final_type = R_PARISC_LTOFF_FPTR21L;
665 break;
9e103c9c
JL
666 case e_lpsel:
667 final_type = R_PARISC_PLABEL21L;
668 break;
669 default:
189c6563 670 return R_PARISC_NONE;
9e103c9c
JL
671 }
672 break;
673
674 case 32:
675 switch (field)
676 {
677 case e_fsel:
678 final_type = R_PARISC_DIR32;
432bdd91
JL
679 /* When in 64bit mode, a 32bit relocation is supposed to
680 be a section relative relocation. Dwarf2 (for example)
681 uses 32bit section relative relocations. */
30d10e9e 682 if (bfd_arch_bits_per_address (abfd) != 32)
46fe4e66 683 final_type = R_PARISC_SECREL32;
9e103c9c
JL
684 break;
685 case e_psel:
686 final_type = R_PARISC_PLABEL32;
687 break;
688 default:
189c6563 689 return R_PARISC_NONE;
9e103c9c
JL
690 }
691 break;
692
6e2bf930
JL
693 case 64:
694 switch (field)
695 {
696 case e_fsel:
697 final_type = R_PARISC_DIR64;
698 break;
699 case e_psel:
36860900
JL
700 final_type = R_PARISC_FPTR64;
701 break;
6e2bf930 702 default:
189c6563 703 return R_PARISC_NONE;
6e2bf930
JL
704 }
705 break;
706
9e103c9c 707 default:
189c6563 708 return R_PARISC_NONE;
9e103c9c
JL
709 }
710 break;
711
9e103c9c
JL
712 case R_HPPA_GOTOFF:
713 switch (format)
714 {
715 case 14:
716 switch (field)
717 {
718 case e_rsel:
719 case e_rrsel:
47d89dba 720 case e_rdsel:
9b52905e 721 /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32. */
6e2bf930 722 final_type = base_type + OFFSET_14R_FROM_21L;
9e103c9c
JL
723 break;
724 case e_fsel:
9b52905e 725 /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32. */
6e2bf930 726 final_type = base_type + OFFSET_14F_FROM_21L;
9e103c9c
JL
727 break;
728 default:
189c6563 729 return R_PARISC_NONE;
9e103c9c
JL
730 }
731 break;
732
733 case 21:
734 switch (field)
735 {
9e103c9c 736 case e_lsel:
edd21aca 737 case e_lrsel:
47d89dba 738 case e_ldsel:
edd21aca
AM
739 case e_nlsel:
740 case e_nlrsel:
9b52905e 741 /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32. */
6e2bf930 742 final_type = base_type;
9e103c9c
JL
743 break;
744 default:
189c6563 745 return R_PARISC_NONE;
9e103c9c
JL
746 }
747 break;
748
6bba1048
DA
749 case 64:
750 switch (field)
751 {
752 case e_fsel:
753 final_type = R_PARISC_GPREL64;
754 break;
755 default:
756 return R_PARISC_NONE;
757 }
758 break;
759
9e103c9c 760 default:
189c6563 761 return R_PARISC_NONE;
9e103c9c
JL
762 }
763 break;
764
9e103c9c
JL
765 case R_HPPA_PCREL_CALL:
766 switch (format)
767 {
49bd834c
AM
768 case 12:
769 switch (field)
770 {
771 case e_fsel:
772 final_type = R_PARISC_PCREL12F;
773 break;
774 default:
189c6563 775 return R_PARISC_NONE;
49bd834c
AM
776 }
777 break;
778
9e103c9c 779 case 14:
49bd834c
AM
780 /* Contrary to appearances, these are not calls of any sort.
781 Rather, they are loads/stores with a pcrel reloc. */
9e103c9c
JL
782 switch (field)
783 {
784 case e_rsel:
785 case e_rrsel:
47d89dba 786 case e_rdsel:
9e103c9c
JL
787 final_type = R_PARISC_PCREL14R;
788 break;
789 case e_fsel:
ba94744e
AM
790 if (bfd_get_mach (abfd) < 25)
791 final_type = R_PARISC_PCREL14F;
792 else
793 final_type = R_PARISC_PCREL16F;
9e103c9c
JL
794 break;
795 default:
189c6563 796 return R_PARISC_NONE;
9e103c9c
JL
797 }
798 break;
799
800 case 17:
801 switch (field)
802 {
803 case e_rsel:
804 case e_rrsel:
47d89dba 805 case e_rdsel:
9e103c9c
JL
806 final_type = R_PARISC_PCREL17R;
807 break;
808 case e_fsel:
809 final_type = R_PARISC_PCREL17F;
810 break;
811 default:
189c6563 812 return R_PARISC_NONE;
9e103c9c
JL
813 }
814 break;
815
edd21aca 816 case 21:
341362b5
JL
817 switch (field)
818 {
edd21aca
AM
819 case e_lsel:
820 case e_lrsel:
47d89dba 821 case e_ldsel:
edd21aca
AM
822 case e_nlsel:
823 case e_nlrsel:
824 final_type = R_PARISC_PCREL21L;
341362b5
JL
825 break;
826 default:
189c6563 827 return R_PARISC_NONE;
341362b5
JL
828 }
829 break;
830
edd21aca 831 case 22:
9e103c9c
JL
832 switch (field)
833 {
edd21aca
AM
834 case e_fsel:
835 final_type = R_PARISC_PCREL22F;
9e103c9c
JL
836 break;
837 default:
189c6563 838 return R_PARISC_NONE;
9e103c9c
JL
839 }
840 break;
841
9992270f
DA
842 case 32:
843 switch (field)
844 {
845 case e_fsel:
846 final_type = R_PARISC_PCREL32;
847 break;
848 default:
849 return R_PARISC_NONE;
850 }
851 break;
852
853 case 64:
854 switch (field)
855 {
856 case e_fsel:
857 final_type = R_PARISC_PCREL64;
858 break;
859 default:
860 return R_PARISC_NONE;
861 }
862 break;
863
9e103c9c 864 default:
189c6563 865 return R_PARISC_NONE;
9e103c9c
JL
866 }
867 break;
868
9b52905e
NC
869 case R_PARISC_TLS_GD21L:
870 switch (field)
871 {
872 case e_ltsel:
873 case e_lrsel:
874 final_type = R_PARISC_TLS_GD21L;
875 break;
876 case e_rtsel:
877 case e_rrsel:
878 final_type = R_PARISC_TLS_GD14R;
879 break;
880 default:
881 return R_PARISC_NONE;
882 }
883 break;
884
885 case R_PARISC_TLS_LDM21L:
886 switch (field)
887 {
888 case e_ltsel:
889 case e_lrsel:
890 final_type = R_PARISC_TLS_LDM21L;
891 break;
892 case e_rtsel:
893 case e_rrsel:
894 final_type = R_PARISC_TLS_LDM14R;
895 break;
896 default:
897 return R_PARISC_NONE;
898 }
899 break;
900
901 case R_PARISC_TLS_LDO21L:
902 switch (field)
903 {
904 case e_lrsel:
905 final_type = R_PARISC_TLS_LDO21L;
906 break;
907 case e_rrsel:
908 final_type = R_PARISC_TLS_LDO14R;
909 break;
910 default:
911 return R_PARISC_NONE;
912 }
913 break;
914
915 case R_PARISC_TLS_IE21L:
916 switch (field)
917 {
918 case e_ltsel:
919 case e_lrsel:
920 final_type = R_PARISC_TLS_IE21L;
921 break;
922 case e_rtsel:
923 case e_rrsel:
924 final_type = R_PARISC_TLS_IE14R;
925 break;
926 default:
927 return R_PARISC_NONE;
928 }
929 break;
930
931 case R_PARISC_TLS_LE21L:
932 switch (field)
933 {
934 case e_lrsel:
935 final_type = R_PARISC_TLS_LE21L;
936 break;
937 case e_rrsel:
938 final_type = R_PARISC_TLS_LE14R;
939 break;
940 default:
941 return R_PARISC_NONE;
942 }
943 break;
944
6bba1048
DA
945 case R_PARISC_SEGREL32:
946 switch (format)
947 {
948 case 32:
949 switch (field)
950 {
951 case e_fsel:
952 final_type = R_PARISC_SEGREL32;
953 break;
954 default:
955 return R_PARISC_NONE;
956 }
957 break;
958
959 case 64:
960 switch (field)
961 {
962 case e_fsel:
963 final_type = R_PARISC_SEGREL64;
964 break;
965 default:
966 return R_PARISC_NONE;
967 }
968 break;
969
970 default:
971 return R_PARISC_NONE;
972 }
973 break;
974
49bd834c
AM
975 case R_PARISC_GNU_VTENTRY:
976 case R_PARISC_GNU_VTINHERIT:
fc91f658
JL
977 case R_PARISC_SEGBASE:
978 /* The defaults are fine for these cases. */
979 break;
980
9e103c9c 981 default:
189c6563 982 return R_PARISC_NONE;
9e103c9c
JL
983 }
984
189c6563
AM
985 return final_type;
986}
987
988/* Return one (or more) BFD relocations which implement the base
989 relocation with modifications based on format and field. */
990
991elf_hppa_reloc_type **
c39a58e6
AM
992_bfd_elf_hppa_gen_reloc_type (bfd *abfd,
993 elf_hppa_reloc_type base_type,
994 int format,
995 unsigned int field,
996 int ignore ATTRIBUTE_UNUSED,
997 asymbol *sym ATTRIBUTE_UNUSED)
189c6563
AM
998{
999 elf_hppa_reloc_type *finaltype;
1000 elf_hppa_reloc_type **final_types;
1001 bfd_size_type amt = sizeof (elf_hppa_reloc_type *) * 2;
1002
1003 /* Allocate slots for the BFD relocation. */
c39a58e6 1004 final_types = bfd_alloc (abfd, amt);
189c6563
AM
1005 if (final_types == NULL)
1006 return NULL;
1007
1008 /* Allocate space for the relocation itself. */
1009 amt = sizeof (elf_hppa_reloc_type);
c39a58e6 1010 finaltype = bfd_alloc (abfd, amt);
189c6563
AM
1011 if (finaltype == NULL)
1012 return NULL;
1013
1014 /* Some reasonable defaults. */
1015 final_types[0] = finaltype;
1016 final_types[1] = NULL;
1017
1018 *finaltype = elf_hppa_reloc_final_type (abfd, base_type, format, field);
1019
9e103c9c
JL
1020 return final_types;
1021}
1022
1023/* Translate from an elf into field into a howto relocation pointer. */
1024
1025static void
c39a58e6
AM
1026elf_hppa_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
1027 arelent *bfd_reloc,
1028 Elf_Internal_Rela *elf_reloc)
9e103c9c 1029{
c39a58e6 1030 BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info)
9e103c9c
JL
1031 < (unsigned int) R_PARISC_UNIMPLEMENTED);
1032 bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
1033}
1034
1035/* Translate from an elf into field into a howto relocation pointer. */
1036
1037static void
c39a58e6
AM
1038elf_hppa_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
1039 arelent *bfd_reloc,
1040 Elf_Internal_Rela *elf_reloc)
9e103c9c 1041{
9b52905e 1042 BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info)
9e103c9c
JL
1043 < (unsigned int) R_PARISC_UNIMPLEMENTED);
1044 bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
1045}
1046
1047/* Return the address of the howto table entry to perform the CODE
1048 relocation for an ARCH machine. */
1049
1050static reloc_howto_type *
c39a58e6
AM
1051elf_hppa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
1052 bfd_reloc_code_real_type code)
9e103c9c
JL
1053{
1054 if ((int) code < (int) R_PARISC_UNIMPLEMENTED)
1055 {
1056 BFD_ASSERT ((int) elf_hppa_howto_table[(int) code].type == (int) code);
1057 return &elf_hppa_howto_table[(int) code];
1058 }
1059 return NULL;
1060}
95cbae0b 1061
157090f7
AM
1062static reloc_howto_type *
1063elf_hppa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
1064 const char *r_name)
1065{
1066 unsigned int i;
1067
1068 for (i = 0;
1069 i < sizeof (elf_hppa_howto_table) / sizeof (elf_hppa_howto_table[0]);
1070 i++)
1071 if (elf_hppa_howto_table[i].name != NULL
1072 && strcasecmp (elf_hppa_howto_table[i].name, r_name) == 0)
1073 return &elf_hppa_howto_table[i];
1074
1075 return NULL;
1076}
1077
b34976b6 1078/* Return TRUE if SYM represents a local label symbol. */
432bdd91 1079
b34976b6 1080static bfd_boolean
c39a58e6 1081elf_hppa_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name)
432bdd91 1082{
49bd834c 1083 if (name[0] == 'L' && name[1] == '$')
9b52905e 1084 return TRUE;
49bd834c 1085 return _bfd_elf_is_local_label_name (abfd, name);
432bdd91
JL
1086}
1087
052e120f
JL
1088/* Set the correct type for an ELF section. We do this by the
1089 section name, which is a hack, but ought to work. */
1090
b34976b6 1091static bfd_boolean
c39a58e6 1092elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
052e120f 1093{
c39a58e6 1094 const char *name;
052e120f
JL
1095
1096 name = bfd_get_section_name (abfd, sec);
1097
1098 if (strcmp (name, ".PARISC.unwind") == 0)
1099 {
1ca74062 1100 int indx;
edd21aca 1101 asection *asec;
9b52905e 1102
3f9b03b5 1103#if ARCH_SIZE == 64
052e120f 1104 hdr->sh_type = SHT_LOPROC + 1;
3f9b03b5
AM
1105#else
1106 hdr->sh_type = 1;
1107#endif
052e120f
JL
1108 /* ?!? How are unwinds supposed to work for symbols in arbitrary
1109 sections? Or what if we have multiple .text sections in a single
be7582f3 1110 .o file? HP really messed up on this one.
052e120f 1111
1ca74062
JL
1112 Ugh. We can not use elf_section_data (sec)->this_idx at this
1113 point because it is not initialized yet.
1114
1115 So we (gasp) recompute it here. Hopefully nobody ever changes the
1116 way sections are numbered in elf.c! */
edd21aca 1117 for (asec = abfd->sections, indx = 1; asec; asec = asec->next, indx++)
1ca74062 1118 {
edd21aca 1119 if (asec->name && strcmp (asec->name, ".text") == 0)
1ca74062
JL
1120 {
1121 hdr->sh_info = indx;
1122 break;
1123 }
1124 }
be7582f3 1125
052e120f
JL
1126 /* I have no idea if this is really necessary or what it means. */
1127 hdr->sh_entsize = 4;
1128 }
b34976b6 1129 return TRUE;
052e120f
JL
1130}
1131
3f9b03b5 1132static void
c39a58e6
AM
1133elf_hppa_final_write_processing (bfd *abfd,
1134 bfd_boolean linker ATTRIBUTE_UNUSED)
3f9b03b5
AM
1135{
1136 int mach = bfd_get_mach (abfd);
1137
1138 elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL
1139 | EF_PARISC_EXT | EF_PARISC_LSB
1140 | EF_PARISC_WIDE | EF_PARISC_NO_KABP
1141 | EF_PARISC_LAZYSWAP);
1142
1143 if (mach == 10)
1144 elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0;
1145 else if (mach == 11)
1146 elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1;
1147 else if (mach == 20)
1148 elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0;
1149 else if (mach == 25)
1150 elf_elfheader (abfd)->e_flags |= (EF_PARISC_WIDE
1151 | EFA_PARISC_2_0
1152 /* The GNU tools have trapped without
1153 option since 1993, so need to take
1154 a step backwards with the ELF
1155 based toolchains. */
1156 | EF_PARISC_TRAPNIL);
1157}
1158
46fe4e66
AM
1159/* Comparison function for qsort to sort unwind section during a
1160 final link. */
1161
1162static int
c39a58e6 1163hppa_unwind_entry_compare (const void *a, const void *b)
46fe4e66
AM
1164{
1165 const bfd_byte *ap, *bp;
1166 unsigned long av, bv;
1167
c39a58e6 1168 ap = a;
46fe4e66
AM
1169 av = (unsigned long) ap[0] << 24;
1170 av |= (unsigned long) ap[1] << 16;
1171 av |= (unsigned long) ap[2] << 8;
1172 av |= (unsigned long) ap[3];
1173
c39a58e6 1174 bp = b;
46fe4e66
AM
1175 bv = (unsigned long) bp[0] << 24;
1176 bv |= (unsigned long) bp[1] << 16;
1177 bv |= (unsigned long) bp[2] << 8;
1178 bv |= (unsigned long) bp[3];
1179
1180 return av < bv ? -1 : av > bv ? 1 : 0;
1181}
1182
9b52905e
NC
1183static bfd_boolean
1184elf_hppa_sort_unwind (bfd *abfd)
46fe4e66
AM
1185{
1186 asection *s;
1187
1188 /* Magic section names, but this is much safer than having
1189 relocate_section remember where SEGREL32 relocs occurred.
1190 Consider what happens if someone inept creates a linker script
1191 that puts unwind information in .text. */
1192 s = bfd_get_section_by_name (abfd, ".PARISC.unwind");
1193 if (s != NULL)
1194 {
1195 bfd_size_type size;
eea6121a 1196 bfd_byte *contents;
46fe4e66 1197
eea6121a 1198 if (!bfd_malloc_and_get_section (abfd, s, &contents))
b34976b6 1199 return FALSE;
46fe4e66 1200
eea6121a 1201 size = s->size;
46fe4e66
AM
1202 qsort (contents, (size_t) (size / 16), 16, hppa_unwind_entry_compare);
1203
1204 if (! bfd_set_section_contents (abfd, s, contents, (file_ptr) 0, size))
b34976b6 1205 return FALSE;
46fe4e66
AM
1206 }
1207
b34976b6 1208 return TRUE;
46fe4e66
AM
1209}
1210
8a696751
AM
1211/* What to do when ld finds relocations against symbols defined in
1212 discarded sections. */
1213
1214static unsigned int
1215elf_hppa_action_discarded (asection *sec)
1216{
1217 if (strcmp (".PARISC.unwind", sec->name) == 0)
1218 return 0;
1219
1220 return _bfd_elf_default_action_discarded (sec);
1221}
This page took 0.902406 seconds and 4 git commands to generate.