1 /* Common code for PA ELF implementations.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20 #define ELF_HOWTO_TABLE_SIZE R_PARISC_UNIMPLEMENTED + 1
22 /* This file is included by multiple PA ELF BFD backends with different
25 Most of the routines are written to be size independent, but sometimes
26 external constraints require 32 or 64 bit specific code. We remap
27 the definitions/functions as necessary here. */
29 #define ELF_R_TYPE(X) ELF64_R_TYPE(X)
30 #define ELF_R_SYM(X) ELF64_R_SYM(X)
31 #define elf_hppa_internal_shdr Elf64_Internal_Shdr
32 #define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
33 #define elf_hppa_relocate_section elf64_hppa_relocate_section
34 #define bfd_elf_bfd_final_link bfd_elf64_bfd_final_link
35 #define elf_hppa_final_link elf64_hppa_final_link
38 #define ELF_R_TYPE(X) ELF32_R_TYPE(X)
39 #define ELF_R_SYM(X) ELF32_R_SYM(X)
40 #define elf_hppa_internal_shdr Elf32_Internal_Shdr
41 #define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
42 #define elf_hppa_relocate_section elf32_hppa_relocate_section
43 #define bfd_elf_bfd_final_link bfd_elf32_bfd_final_link
44 #define elf_hppa_final_link elf32_hppa_final_link
47 elf_hppa_reloc_type ** _bfd_elf_hppa_gen_reloc_type
48 PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
50 static void elf_hppa_info_to_howto
51 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
53 static void elf_hppa_info_to_howto_rel
54 PARAMS ((bfd *, arelent *, Elf_Internal_Rel *));
56 static reloc_howto_type * elf_hppa_reloc_type_lookup
57 PARAMS ((bfd *, bfd_reloc_code_real_type));
59 static boolean elf_hppa_is_local_label_name
60 PARAMS ((bfd *, const char *));
62 static boolean elf_hppa_fake_sections
63 PARAMS ((bfd *abfd, elf_hppa_internal_shdr *, asection *));
66 static void elf_hppa_final_write_processing
67 PARAMS ((bfd *, boolean));
69 static boolean elf_hppa_add_symbol_hook
70 PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
71 const char **, flagword *, asection **, bfd_vma *));
73 static boolean elf_hppa_unmark_useless_dynamic_symbols
74 PARAMS ((struct elf_link_hash_entry *, PTR));
76 static boolean elf_hppa_remark_useless_dynamic_symbols
77 PARAMS ((struct elf_link_hash_entry *, PTR));
79 static void elf_hppa_record_segment_addrs
80 PARAMS ((bfd *, asection *, PTR));
82 static boolean elf_hppa_final_link
83 PARAMS ((bfd *, struct bfd_link_info *));
85 static boolean elf_hppa_relocate_section
86 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
87 bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
89 static bfd_reloc_status_type elf_hppa_final_link_relocate
90 PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *,
91 bfd_byte *, bfd_vma, struct bfd_link_info *,
92 asection *, struct elf_link_hash_entry *,
93 struct elf64_hppa_dyn_hash_entry *));
95 static unsigned int elf_hppa_relocate_insn
96 PARAMS ((unsigned int, unsigned int, unsigned int));
100 /* ELF/PA relocation howto entries. */
102 static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
104 { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
105 bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false },
107 /* The values in DIR32 are to placate the check in
108 _bfd_stab_section_find_nearest_line. */
109 { R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield,
110 bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false },
111 { R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
112 bfd_elf_generic_reloc, "R_PARISC_DIR21L", false, 0, 0, false },
113 { R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield,
114 bfd_elf_generic_reloc, "R_PARISC_DIR17R", false, 0, 0, false },
115 { R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield,
116 bfd_elf_generic_reloc, "R_PARISC_DIR17F", false, 0, 0, false },
117 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
118 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
119 { R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
120 bfd_elf_generic_reloc, "R_PARISC_DIR14R", false, 0, 0, false },
121 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
122 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
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_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield,
126 bfd_elf_generic_reloc, "R_PARISC_PCREL32", false, 0, 0, false },
128 { R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield,
129 bfd_elf_generic_reloc, "R_PARISC_PCREL21L", false, 0, 0, false },
130 { R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield,
131 bfd_elf_generic_reloc, "R_PARISC_PCREL17R", false, 0, 0, false },
132 { R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield,
133 bfd_elf_generic_reloc, "R_PARISC_PCREL17F", false, 0, 0, false },
134 { R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield,
135 bfd_elf_generic_reloc, "R_PARISC_PCREL17C", false, 0, 0, false },
136 { R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield,
137 bfd_elf_generic_reloc, "R_PARISC_PCREL14R", false, 0, 0, false },
138 { R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield,
139 bfd_elf_generic_reloc, "R_PARISC_PCREL14F", false, 0, 0, false },
140 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
141 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
142 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
143 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
144 { R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
145 bfd_elf_generic_reloc, "R_PARISC_DPREL21L", false, 0, 0, false },
146 { R_PARISC_DPREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
147 bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", false, 0, 0, false },
149 { R_PARISC_DPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
150 bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", false, 0, 0, false },
151 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
152 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
153 { R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
154 bfd_elf_generic_reloc, "R_PARISC_DPREL14R", false, 0, 0, false },
155 { R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
156 bfd_elf_generic_reloc, "R_PARISC_DPREL14F", false, 0, 0, false },
157 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
158 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
159 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
160 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
161 { R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
162 bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", 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 },
170 { R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
171 bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", false, 0, 0, false },
172 { R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
173 bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", false, 0, 0, false },
174 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
175 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
176 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
177 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
178 { R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
179 bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", 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 },
186 { R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
187 bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", false, 0, 0, false },
188 { R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
189 bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", false, 0, 0, false },
191 { R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield,
192 bfd_elf_generic_reloc, "R_PARISC_SETBASE", false, 0, 0, false },
193 { R_PARISC_SECREL32, 0, 0, 0, false, 0, complain_overflow_bitfield,
194 bfd_elf_generic_reloc, "R_PARISC_SECREL32", false, 0, 0, false },
195 { R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
196 bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", false, 0, 0, false },
197 { R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield,
198 bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", false, 0, 0, false },
199 { R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield,
200 bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", 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 },
203 { R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
204 bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", false, 0, 0, false },
205 { R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
206 bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", false, 0, 0, false },
207 { R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield,
208 bfd_elf_generic_reloc, "R_PARISC_SEGBASE", false, 0, 0, false },
209 { R_PARISC_SEGREL32, 0, 0, 0, false, 0, complain_overflow_bitfield,
210 bfd_elf_generic_reloc, "R_PARISC_SEGREL32", false, 0, 0, false },
212 { R_PARISC_PLTOFF21L, 0, 0, 0, false, 0, complain_overflow_bitfield,
213 bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", false, 0, 0, false },
214 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
215 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
216 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
217 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
218 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
219 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
220 { R_PARISC_PLTOFF14R, 0, 0, 0, false, 0, complain_overflow_bitfield,
221 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", false, 0, 0, false },
222 { R_PARISC_PLTOFF14F, 0, 0, 0, false, 0, complain_overflow_bitfield,
223 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", false, 0, 0, false },
224 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
225 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
226 { R_PARISC_LTOFF_FPTR32, 0, 0, 0, false, 0, complain_overflow_bitfield,
227 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", false, 0, 0, false },
228 { R_PARISC_LTOFF_FPTR21L, 0, 0, 0, false, 0, complain_overflow_bitfield,
229 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", false, 0, 0, false },
230 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
231 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
233 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
234 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
235 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
236 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
237 { R_PARISC_LTOFF_FPTR14R, 0, 0, 0, false, 0, complain_overflow_bitfield,
238 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", false, 0, 0, false },
239 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
240 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
241 { R_PARISC_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield,
242 bfd_elf_generic_reloc, "R_PARISC_FPTR64", false, 0, 0, false },
243 { R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield,
244 bfd_elf_generic_reloc, "R_PARISC_PLABEL32", false, 0, 0, false },
245 { R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
246 bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", false, 0, 0, false },
247 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
248 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
249 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
250 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
251 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
252 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
254 { R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
255 bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", false, 0, 0, false },
256 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
257 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
258 { R_PARISC_PCREL64, 0, 0, 0, false, 0, complain_overflow_bitfield,
259 bfd_elf_generic_reloc, "R_PARISC_PCREL64", false, 0, 0, false },
260 { R_PARISC_PCREL22C, 0, 0, 0, false, 0, complain_overflow_bitfield,
261 bfd_elf_generic_reloc, "R_PARISC_PCREL22C", false, 0, 0, false },
262 { R_PARISC_PCREL22F, 0, 0, 0, false, 0, complain_overflow_bitfield,
263 bfd_elf_generic_reloc, "R_PARISC_PCREL22F", false, 0, 0, false },
264 { R_PARISC_PCREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
265 bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", false, 0, 0, false },
266 { R_PARISC_PCREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
267 bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", false, 0, 0, false },
268 { R_PARISC_PCREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
269 bfd_elf_generic_reloc, "R_PARISC_PCREL16F", false, 0, 0, false },
270 { R_PARISC_PCREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
271 bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", false, 0, 0, false },
272 { R_PARISC_PCREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
273 bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", false, 0, 0, false },
275 { R_PARISC_DIR64, 0, 0, 0, false, 0, complain_overflow_bitfield,
276 bfd_elf_generic_reloc, "R_PARISC_DIR64", false, 0, 0, false },
277 { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
278 bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false },
279 { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
280 bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false },
281 { R_PARISC_DIR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
282 bfd_elf_generic_reloc, "R_PARISC_DIR14WR", false, 0, 0, false },
283 { R_PARISC_DIR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
284 bfd_elf_generic_reloc, "R_PARISC_DIR14DR", false, 0, 0, false },
285 { R_PARISC_DIR16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
286 bfd_elf_generic_reloc, "R_PARISC_DIR16F", false, 0, 0, false },
287 { R_PARISC_DIR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
288 bfd_elf_generic_reloc, "R_PARISC_DIR16WF", false, 0, 0, false },
289 { R_PARISC_DIR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
290 bfd_elf_generic_reloc, "R_PARISC_DIR16DF", false, 0, 0, false },
291 { R_PARISC_GPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield,
292 bfd_elf_generic_reloc, "R_PARISC_GPREL64", false, 0, 0, false },
293 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
294 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
296 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
297 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
298 { R_PARISC_DLTREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
299 bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", false, 0, 0, false },
300 { R_PARISC_DLTREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
301 bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", false, 0, 0, false },
302 { R_PARISC_GPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
303 bfd_elf_generic_reloc, "R_PARISC_GPREL16F", false, 0, 0, false },
304 { R_PARISC_GPREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
305 bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", false, 0, 0, false },
306 { R_PARISC_GPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
307 bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", false, 0, 0, false },
308 { R_PARISC_LTOFF64, 0, 0, 0, false, 0, complain_overflow_bitfield,
309 bfd_elf_generic_reloc, "R_PARISC_LTOFF64", false, 0, 0, false },
310 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
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_DLTIND14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
315 bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", false, 0, 0, false },
317 { R_PARISC_DLTIND14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
318 bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", false, 0, 0, false },
319 { R_PARISC_LTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
320 bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", false, 0, 0, false },
321 { R_PARISC_LTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
322 bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false },
323 { R_PARISC_LTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
324 bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false },
325 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
326 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
327 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
328 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
329 { R_PARISC_BASEREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
330 bfd_elf_generic_reloc, "R_PARISC_BSEREL14WR", false, 0, 0, false },
331 { R_PARISC_BASEREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
332 bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", 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 },
338 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
339 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
340 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
341 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
342 { R_PARISC_SEGREL64, 0, 0, 0, false, 0, complain_overflow_bitfield,
343 bfd_elf_generic_reloc, "R_PARISC_SEGREL64", false, 0, 0, false },
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_bitfield,
347 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
348 { R_PARISC_PLTOFF14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
349 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", false, 0, 0, false },
350 { R_PARISC_PLTOFF14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
351 bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", false, 0, 0, false },
352 { R_PARISC_PLTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
353 bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", false, 0, 0, false },
354 { R_PARISC_PLTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
355 bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", false, 0, 0, false },
356 { R_PARISC_PLTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
357 bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", false, 0, 0, false },
359 { R_PARISC_LTOFF_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield,
360 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
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_LTOFF_FPTR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
366 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", false, 0, 0, false },
367 { R_PARISC_LTOFF_FPTR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
368 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", false, 0, 0, false },
369 { R_PARISC_LTOFF_FPTR16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
370 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", false, 0, 0, false },
371 { R_PARISC_LTOFF_FPTR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
372 bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", false, 0, 0, false },
373 { R_PARISC_LTOFF_FPTR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
374 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
375 { R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield,
376 bfd_elf_generic_reloc, "R_PARISC_COPY", false, 0, 0, false },
377 { R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield,
378 bfd_elf_generic_reloc, "R_PARISC_IPLT", false, 0, 0, false },
380 { R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield,
381 bfd_elf_generic_reloc, "R_PARISC_EPLT", false, 0, 0, false },
382 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
383 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
384 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
385 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
386 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
387 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
388 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
389 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
390 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
391 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
392 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
393 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
394 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
395 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
396 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
397 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
398 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
399 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
401 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
402 NULL, "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 },
407 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
408 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
409 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
410 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
411 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
412 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
413 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
414 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
415 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
416 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
417 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
418 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
419 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
420 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
422 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
423 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
424 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
425 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
426 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
427 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
428 { R_PARISC_TPREL32, 0, 0, 0, false, 0, complain_overflow_dont,
429 NULL, "R_PARISC_TPREL32", false, 0, 0, false },
430 { R_PARISC_TPREL21L, 0, 0, 0, false, 0, complain_overflow_dont,
431 NULL, "R_PARISC_TPREL21L", false, 0, 0, false },
432 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
433 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
434 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
435 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
436 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
437 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
438 { R_PARISC_TPREL14R, 0, 0, 0, false, 0, complain_overflow_dont,
439 NULL, "R_PARISC_TPREL14R", false, 0, 0, false },
440 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
441 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
443 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
444 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
445 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
446 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
447 { R_PARISC_LTOFF_TP21L, 0, 0, 0, false, 0, complain_overflow_bitfield,
448 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", false, 0, 0, false },
449 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
450 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
451 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
452 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
453 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
454 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
455 { R_PARISC_LTOFF_TP14R, 0, 0, 0, false, 0, complain_overflow_bitfield,
456 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
457 { R_PARISC_LTOFF_TP14F, 0, 0, 0, false, 0, complain_overflow_bitfield,
458 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", false, 0, 0, false },
459 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
460 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
461 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
462 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
464 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
465 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
466 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
467 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
468 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
469 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
470 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
471 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
472 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
473 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
474 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
475 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
476 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
477 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
478 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
479 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
480 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
481 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
482 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
483 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
485 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
486 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
487 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
488 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
489 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
490 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
491 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
492 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
493 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
494 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
495 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
496 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
497 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
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_dont,
502 NULL, "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 },
506 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
507 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
508 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
509 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
510 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
511 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
512 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
513 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
514 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
515 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", 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 },
520 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
521 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
522 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
523 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
524 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
525 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
527 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
528 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
529 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
530 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
531 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
532 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", 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 },
537 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
538 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
539 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
540 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
541 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
542 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
543 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
544 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
545 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
546 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
548 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
549 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
550 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
551 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
552 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
553 NULL, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
554 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
555 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
556 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
557 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
558 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
559 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
560 { R_PARISC_TPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield,
561 bfd_elf_generic_reloc, "R_PARISC_TPREL64", false, 0, 0, false },
562 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
563 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
564 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
565 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
566 { R_PARISC_TPREL14WR, 0, 0, 0, false, 0, complain_overflow_dont,
567 NULL, "R_PARISC_TPREL14WR", false, 0, 0, false },
569 { R_PARISC_TPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
570 bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", false, 0, 0, false },
571 { R_PARISC_TPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield,
572 bfd_elf_generic_reloc, "R_PARISC_TPREL16F", false, 0, 0, false },
573 { R_PARISC_TPREL16WF, 0, 0, 0, false, 0, complain_overflow_dont,
574 NULL, "R_PARISC_TPREL16WF", false, 0, 0, false },
575 { R_PARISC_TPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
576 bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", false, 0, 0, false },
577 { R_PARISC_LTOFF_TP64, 0, 0, 0, false, 0, complain_overflow_bitfield,
578 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", false, 0, 0, false },
579 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
580 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
581 { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
582 bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
583 { R_PARISC_LTOFF_TP14WR, 0, 0, 0, false, 0, complain_overflow_bitfield,
584 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", false, 0, 0, false },
585 { R_PARISC_LTOFF_TP14DR, 0, 0, 0, false, 0, complain_overflow_bitfield,
586 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", false, 0, 0, false },
587 { R_PARISC_LTOFF_TP16F, 0, 0, 0, false, 0, complain_overflow_dont,
588 NULL, "R_PARISC_LTOFF_TP16F", false, 0, 0, false },
590 { R_PARISC_LTOFF_TP16WF, 0, 0, 0, false, 0, complain_overflow_bitfield,
591 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", false, 0, 0, false },
592 { R_PARISC_LTOFF_TP16DF, 0, 0, 0, false, 0, complain_overflow_bitfield,
593 bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", false, 0, 0, false },
596 #define OFFSET_14R_FROM_21L 4
597 #define OFFSET_14F_FROM_21L 5
599 /* Return one (or more) BFD relocations which implement the base
600 relocation with modifications based on format and field. */
602 elf_hppa_reloc_type **
603 _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
605 elf_hppa_reloc_type base_type;
608 int ignore ATTRIBUTE_UNUSED;
609 asymbol *sym ATTRIBUTE_UNUSED;
611 elf_hppa_reloc_type *finaltype;
612 elf_hppa_reloc_type **final_types;
614 /* Allocate slots for the BFD relocation. */
615 final_types = ((elf_hppa_reloc_type **)
616 bfd_alloc (abfd, sizeof (elf_hppa_reloc_type *) * 2));
617 if (final_types == NULL)
620 /* Allocate space for the relocation itself. */
621 finaltype = ((elf_hppa_reloc_type *)
622 bfd_alloc (abfd, sizeof (elf_hppa_reloc_type)));
623 if (finaltype == NULL)
626 /* Some reasonable defaults. */
627 final_types[0] = finaltype;
628 final_types[1] = NULL;
630 #define final_type finaltype[0]
632 final_type = base_type;
634 /* Just a tangle of nested switch statements to deal with the braindamage
635 that a different field selector means a completely different relocation
639 /* We have been using generic relocation types. However, that may not
640 really make sense. Anyway, we need to support both R_PARISC_DIR64
641 and R_PARISC_DIR32 here. */
644 case R_HPPA_ABS_CALL:
652 final_type = R_PARISC_DIR14R;
655 final_type = R_PARISC_DLTIND14R;
658 final_type = R_PARISC_LTOFF_FPTR14DR;
661 final_type = R_PARISC_DLTIND14F;
664 final_type = R_PARISC_PLABEL14R;
675 final_type = R_PARISC_DIR17F;
679 final_type = R_PARISC_DIR17R;
693 final_type = R_PARISC_DIR21L;
696 final_type = R_PARISC_DLTIND21L;
699 final_type = R_PARISC_LTOFF_FPTR21L;
702 final_type = R_PARISC_PLABEL21L;
713 final_type = R_PARISC_DIR32;
714 /* When in 64bit mode, a 32bit relocation is supposed to
715 be a section relative relocation. Dwarf2 (for example)
716 uses 32bit section relative relocations. */
717 if (bfd_get_arch_info (abfd)->bits_per_address != 32)
718 final_type = R_PARISC_SECREL32;
721 final_type = R_PARISC_PLABEL32;
732 final_type = R_PARISC_DIR64;
735 final_type = R_PARISC_FPTR64;
756 /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32 */
757 final_type = base_type + OFFSET_14R_FROM_21L;
760 /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32 */
761 final_type = base_type + OFFSET_14F_FROM_21L;
775 /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32 */
776 final_type = base_type;
789 case R_HPPA_PCREL_CALL:
797 final_type = R_PARISC_PCREL14R;
800 final_type = R_PARISC_PCREL14F;
812 final_type = R_PARISC_PCREL17R;
815 final_type = R_PARISC_PCREL17F;
829 final_type = R_PARISC_PCREL21L;
840 final_type = R_PARISC_PCREL22F;
852 case R_PARISC_SEGREL32:
853 case R_PARISC_SEGBASE:
854 /* The defaults are fine for these cases. */
864 /* Translate from an elf into field into a howto relocation pointer. */
867 elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc)
868 bfd *abfd ATTRIBUTE_UNUSED;
870 Elf_Internal_Rela *elf_reloc;
872 BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
873 < (unsigned int) R_PARISC_UNIMPLEMENTED);
874 bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
877 /* Translate from an elf into field into a howto relocation pointer. */
880 elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
881 bfd *abfd ATTRIBUTE_UNUSED;
883 Elf_Internal_Rel *elf_reloc;
885 BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
886 < (unsigned int) R_PARISC_UNIMPLEMENTED);
887 bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
890 /* Return the address of the howto table entry to perform the CODE
891 relocation for an ARCH machine. */
893 static reloc_howto_type *
894 elf_hppa_reloc_type_lookup (abfd, code)
895 bfd *abfd ATTRIBUTE_UNUSED;
896 bfd_reloc_code_real_type code;
898 if ((int) code < (int) R_PARISC_UNIMPLEMENTED)
900 BFD_ASSERT ((int) elf_hppa_howto_table[(int) code].type == (int) code);
901 return &elf_hppa_howto_table[(int) code];
906 /* Return true if SYM represents a local label symbol. */
909 elf_hppa_is_local_label_name (abfd, name)
910 bfd *abfd ATTRIBUTE_UNUSED;
913 return (name[0] == 'L' && name[1] == '$');
916 /* Set the correct type for an ELF section. We do this by the
917 section name, which is a hack, but ought to work. */
920 elf_hppa_fake_sections (abfd, hdr, sec)
922 elf_hppa_internal_shdr *hdr;
925 register const char *name;
927 name = bfd_get_section_name (abfd, sec);
929 if (strcmp (name, ".PARISC.unwind") == 0)
934 hdr->sh_type = SHT_LOPROC + 1;
938 /* ?!? How are unwinds supposed to work for symbols in arbitrary
939 sections? Or what if we have multiple .text sections in a single
940 .o file? HP really messed up on this one.
942 Ugh. We can not use elf_section_data (sec)->this_idx at this
943 point because it is not initialized yet.
945 So we (gasp) recompute it here. Hopefully nobody ever changes the
946 way sections are numbered in elf.c! */
947 for (asec = abfd->sections, indx = 1; asec; asec = asec->next, indx++)
949 if (asec->name && strcmp (asec->name, ".text") == 0)
956 /* I have no idea if this is really necessary or what it means. */
964 elf_hppa_final_write_processing (abfd, linker)
966 boolean linker ATTRIBUTE_UNUSED;
968 int mach = bfd_get_mach (abfd);
970 elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL
971 | EF_PARISC_EXT | EF_PARISC_LSB
972 | EF_PARISC_WIDE | EF_PARISC_NO_KABP
973 | EF_PARISC_LAZYSWAP);
976 elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0;
978 elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1;
980 elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0;
982 elf_elfheader (abfd)->e_flags |= (EF_PARISC_WIDE
984 /* The GNU tools have trapped without
985 option since 1993, so need to take
986 a step backwards with the ELF
988 | EF_PARISC_TRAPNIL);
991 /* Hook called by the linker routine which adds symbols from an object
992 file. HP's libraries define symbols with HP specific section
993 indices, which we have to handle. */
996 elf_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
998 struct bfd_link_info *info ATTRIBUTE_UNUSED;
999 const Elf_Internal_Sym *sym;
1000 const char **namep ATTRIBUTE_UNUSED;
1001 flagword *flagsp ATTRIBUTE_UNUSED;
1005 int index = sym->st_shndx;
1009 case SHN_PARISC_ANSI_COMMON:
1010 *secp = bfd_make_section_old_way (abfd, ".PARISC.ansi.common");
1011 (*secp)->flags |= SEC_IS_COMMON;
1012 *valp = sym->st_size;
1015 case SHN_PARISC_HUGE_COMMON:
1016 *secp = bfd_make_section_old_way (abfd, ".PARISC.huge.common");
1017 (*secp)->flags |= SEC_IS_COMMON;
1018 *valp = sym->st_size;
1026 elf_hppa_unmark_useless_dynamic_symbols (h, data)
1027 struct elf_link_hash_entry *h;
1030 struct bfd_link_info *info = (struct bfd_link_info *)data;
1032 /* If we are not creating a shared library, and this symbol is
1033 referenced by a shared library but is not defined anywhere, then
1034 the generic code will warn that it is undefined.
1036 This behavior is undesirable on HPs since the standard shared
1037 libraries contain references to undefined symbols.
1039 So we twiddle the flags associated with such symbols so that they
1040 will not trigger the warning. ?!? FIXME. This is horribly fragile.
1042 Ultimately we should have better controls over the generic ELF BFD
1044 if (! info->relocateable
1046 && !info->no_undefined)
1047 && h->root.type == bfd_link_hash_undefined
1048 && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
1049 && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
1051 h->elf_link_hash_flags &= ~ELF_LINK_HASH_REF_DYNAMIC;
1052 h->elf_link_hash_flags |= 0x8000;
1060 elf_hppa_remark_useless_dynamic_symbols (h, data)
1061 struct elf_link_hash_entry *h;
1064 struct bfd_link_info *info = (struct bfd_link_info *)data;
1066 /* If we are not creating a shared library, and this symbol is
1067 referenced by a shared library but is not defined anywhere, then
1068 the generic code will warn that it is undefined.
1070 This behavior is undesirable on HPs since the standard shared
1071 libraries contain reerences to undefined symbols.
1073 So we twiddle the flags associated with such symbols so that they
1074 will not trigger the warning. ?!? FIXME. This is horribly fragile.
1076 Ultimately we should have better controls over the generic ELF BFD
1078 if (! info->relocateable
1080 && !info->no_undefined)
1081 && h->root.type == bfd_link_hash_undefined
1082 && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
1083 && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
1084 && (h->elf_link_hash_flags & 0x8000) != 0)
1086 h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
1087 h->elf_link_hash_flags &= ~0x8000;
1093 /* Record the lowest address for the data and text segments. */
1095 elf_hppa_record_segment_addrs (abfd, section, data)
1096 bfd *abfd ATTRIBUTE_UNUSED;
1100 struct elf64_hppa_link_hash_table *hppa_info;
1103 hppa_info = (struct elf64_hppa_link_hash_table *)data;
1105 value = section->vma - section->filepos;
1107 if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
1108 == (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
1109 && value < hppa_info->text_segment_base)
1110 hppa_info->text_segment_base = value;
1111 else if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
1112 == (SEC_ALLOC | SEC_LOAD))
1113 && value < hppa_info->data_segment_base)
1114 hppa_info->data_segment_base = value;
1117 /* Called after we have seen all the input files/sections, but before
1118 final symbol resolution and section placement has been determined.
1120 We use this hook to (possibly) provide a value for __gp, then we
1121 fall back to the generic ELF final link routine. */
1124 elf_hppa_final_link (abfd, info)
1126 struct bfd_link_info *info;
1129 struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
1131 if (! info->relocateable)
1133 struct elf_link_hash_entry *gp;
1136 /* The linker script defines a value for __gp iff it was referenced
1137 by one of the objects being linked. First try to find the symbol
1138 in the hash table. If that fails, just compute the value __gp
1140 gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", false,
1146 /* Adjust the value of __gp as we may want to slide it into the
1147 .plt section so that the stubs can access PLT entries without
1148 using an addil sequence. */
1149 gp->root.u.def.value += hppa_info->gp_offset;
1151 gp_val = (gp->root.u.def.section->output_section->vma
1152 + gp->root.u.def.section->output_offset
1153 + gp->root.u.def.value);
1160 /* First look for a .plt section. If found, then __gp is the
1161 address of the .plt + gp_offset.
1163 If no .plt is found, then look for .dlt, .opd and .data (in
1164 that order) and set __gp to the base address of whichever section
1167 sec = hppa_info->plt_sec;
1169 gp_val = (sec->output_offset
1170 + sec->output_section->vma
1171 + hppa_info->gp_offset);
1174 sec = hppa_info->dlt_sec;
1176 sec = hppa_info->opd_sec;
1178 sec = bfd_get_section_by_name (abfd, ".data");
1182 gp_val = sec->output_offset + sec->output_section->vma;
1186 /* Install whatever value we found/computed for __gp. */
1187 _bfd_set_gp_value (abfd, gp_val);
1190 /* We need to know the base of the text and data segments so that we
1191 can perform SEGREL relocations. We will record the base addresses
1192 when we encounter the first SEGREL relocation. */
1193 hppa_info->text_segment_base = (bfd_vma)-1;
1194 hppa_info->data_segment_base = (bfd_vma)-1;
1196 /* HP's shared libraries have references to symbols that are not
1197 defined anywhere. The generic ELF BFD linker code will complaim
1200 So we detect the losing case and arrange for the flags on the symbol
1201 to indicate that it was never referenced. This keeps the generic
1202 ELF BFD link code happy and appears to not create any secondary
1203 problems. Ultimately we need a way to control the behavior of the
1204 generic ELF BFD link code better. */
1205 elf_link_hash_traverse (elf_hash_table (info),
1206 elf_hppa_unmark_useless_dynamic_symbols,
1209 /* Invoke the regular ELF backend linker to do all the work. */
1210 retval = bfd_elf_bfd_final_link (abfd, info);
1212 elf_link_hash_traverse (elf_hash_table (info),
1213 elf_hppa_remark_useless_dynamic_symbols,
1219 /* Relocate an HPPA ELF section. */
1222 elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
1223 contents, relocs, local_syms, local_sections)
1225 struct bfd_link_info *info;
1227 asection *input_section;
1229 Elf_Internal_Rela *relocs;
1230 Elf_Internal_Sym *local_syms;
1231 asection **local_sections;
1233 Elf_Internal_Shdr *symtab_hdr;
1234 Elf_Internal_Rela *rel;
1235 Elf_Internal_Rela *relend;
1236 struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
1238 symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
1241 relend = relocs + input_section->reloc_count;
1242 for (; rel < relend; rel++)
1245 reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info);
1246 unsigned long r_symndx;
1247 struct elf_link_hash_entry *h;
1248 Elf_Internal_Sym *sym;
1251 bfd_reloc_status_type r;
1252 const char *sym_name;
1253 const char *dyn_name;
1254 char *dynh_buf = NULL;
1255 size_t dynh_buflen = 0;
1256 struct elf64_hppa_dyn_hash_entry *dyn_h = NULL;
1258 r_type = ELF_R_TYPE (rel->r_info);
1259 if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED)
1261 bfd_set_error (bfd_error_bad_value);
1265 r_symndx = ELF_R_SYM (rel->r_info);
1267 if (info->relocateable)
1269 /* This is a relocateable link. We don't have to change
1270 anything, unless the reloc is against a section symbol,
1271 in which case we have to adjust according to where the
1272 section symbol winds up in the output section. */
1273 if (r_symndx < symtab_hdr->sh_info)
1275 sym = local_syms + r_symndx;
1276 if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
1278 sym_sec = local_sections[r_symndx];
1279 rel->r_addend += sym_sec->output_offset;
1286 /* This is a final link. */
1290 if (r_symndx < symtab_hdr->sh_info)
1292 /* This is a local symbol. */
1293 sym = local_syms + r_symndx;
1294 sym_sec = local_sections[r_symndx];
1295 relocation = ((ELF_ST_TYPE (sym->st_info) == STT_SECTION
1296 ? 0 : sym->st_value)
1297 + sym_sec->output_offset
1298 + sym_sec->output_section->vma);
1300 /* If this symbol has an entry in the PA64 dynamic hash
1301 table, then get it. */
1302 dyn_name = get_dyn_name (input_section, h, rel,
1303 &dynh_buf, &dynh_buflen);
1304 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
1305 dyn_name, false, false);
1310 /* This is not a local symbol. */
1313 indx = r_symndx - symtab_hdr->sh_info;
1314 h = elf_sym_hashes (input_bfd)[indx];
1315 while (h->root.type == bfd_link_hash_indirect
1316 || h->root.type == bfd_link_hash_warning)
1317 h = (struct elf_link_hash_entry *) h->root.u.i.link;
1318 if (h->root.type == bfd_link_hash_defined
1319 || h->root.type == bfd_link_hash_defweak)
1321 sym_sec = h->root.u.def.section;
1323 /* If this symbol has an entry in the PA64 dynamic hash
1324 table, then get it. */
1325 dyn_name = get_dyn_name (input_section, h, rel,
1326 &dynh_buf, &dynh_buflen);
1327 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
1328 dyn_name, false, false);
1330 /* If we have a relocation against a symbol defined in a
1331 shared library and we have not created an entry in the
1332 PA64 dynamic symbol hash table for it, then we lose. */
1333 if (sym_sec->output_section == NULL && dyn_h == NULL)
1335 (*_bfd_error_handler)
1336 (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
1337 bfd_get_filename (input_bfd), h->root.root.string,
1338 bfd_get_section_name (input_bfd, input_section));
1341 else if (sym_sec->output_section)
1342 relocation = (h->root.u.def.value
1343 + sym_sec->output_offset
1344 + sym_sec->output_section->vma);
1345 /* Value will be provided via one of the offsets in the
1346 dyn_h hash table entry. */
1350 /* Allow undefined symbols in shared libraries. */
1351 else if (info->shared && !info->no_undefined
1352 && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
1355 (*info->callbacks->undefined_symbol)
1356 (info, h->root.root.string, input_bfd,
1357 input_section, rel->r_offset, false);
1359 /* If this symbol has an entry in the PA64 dynamic hash
1360 table, then get it. */
1361 dyn_name = get_dyn_name (input_section, h, rel,
1362 &dynh_buf, &dynh_buflen);
1363 dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
1364 dyn_name, false, false);
1368 (*_bfd_error_handler)
1369 (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
1370 bfd_get_filename (input_bfd), h->root.root.string,
1371 bfd_get_section_name (input_bfd, input_section));
1376 else if (h->root.type == bfd_link_hash_undefweak)
1380 if (!((*info->callbacks->undefined_symbol)
1381 (info, h->root.root.string, input_bfd,
1382 input_section, rel->r_offset, true)))
1389 sym_name = h->root.root.string;
1392 sym_name = bfd_elf_string_from_elf_section (input_bfd,
1393 symtab_hdr->sh_link,
1395 if (sym_name == NULL)
1397 if (*sym_name == '\0')
1398 sym_name = bfd_section_name (input_bfd, sym_sec);
1401 r = elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
1402 input_section, contents,
1403 relocation, info, sym_sec,
1406 if (r != bfd_reloc_ok)
1412 case bfd_reloc_overflow:
1414 if (!((*info->callbacks->reloc_overflow)
1415 (info, sym_name, howto->name, (bfd_vma) 0,
1416 input_bfd, input_section, rel->r_offset)))
1427 /* Compute the value for a relocation (REL) during a final link stage,
1428 then insert the value into the proper location in CONTENTS.
1430 VALUE is a tentative value for the relocation and may be overridden
1431 and modified here based on the specific relocation to be performed.
1433 For example we do conversions for PC-relative branches in this routine
1434 or redirection of calls to external routines to stubs.
1436 The work of actually applying the relocation is left to a helper
1437 routine in an attempt to reduce the complexity and size of this
1440 static bfd_reloc_status_type
1441 elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
1442 input_section, contents, value,
1443 info, sym_sec, h, dyn_h)
1444 Elf_Internal_Rela *rel;
1447 asection *input_section;
1450 struct bfd_link_info *info;
1452 struct elf_link_hash_entry *h ATTRIBUTE_UNUSED;
1453 struct elf64_hppa_dyn_hash_entry *dyn_h;
1456 bfd_vma offset = rel->r_offset;
1457 bfd_vma addend = rel->r_addend;
1458 reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info);
1459 unsigned int r_type = howto->type;
1460 bfd_byte *hit_data = contents + offset;
1461 struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
1463 insn = bfd_get_32 (input_bfd, hit_data);
1470 /* Basic function call support. I'm not entirely sure if PCREL14F is
1471 actually needed or even handled correctly.
1473 Note for a call to a function defined in another dynamic library
1474 we want to redirect the call to a stub. */
1476 /* Random PC relative relocs. */
1477 case R_PARISC_PCREL21L:
1478 case R_PARISC_PCREL14R:
1479 case R_PARISC_PCREL14F:
1480 case R_PARISC_PCREL14WR:
1481 case R_PARISC_PCREL14DR:
1482 case R_PARISC_PCREL16F:
1483 case R_PARISC_PCREL16WF:
1484 case R_PARISC_PCREL16DF:
1486 /* If this is a call to a function defined in another dynamic
1487 library, then redirect the call to the local stub for this
1489 if (sym_sec == NULL || sym_sec->output_section == NULL)
1490 value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
1491 + hppa_info->stub_sec->output_section->vma);
1493 /* Turn VALUE into a proper PC relative address. */
1494 value -= (offset + input_section->output_offset
1495 + input_section->output_section->vma);
1497 /* Adjust for any field selectors. */
1498 if (r_type == R_PARISC_PCREL21L)
1499 value = hppa_field_adjust (value, -8 + addend, e_lsel);
1500 else if (r_type == R_PARISC_PCREL14F
1501 || r_type == R_PARISC_PCREL16F
1502 || r_type == R_PARISC_PCREL16WF
1503 || r_type == R_PARISC_PCREL16DF)
1504 value = hppa_field_adjust (value, -8 + addend, e_fsel);
1506 value = hppa_field_adjust (value, -8 + addend, e_rsel);
1508 /* Apply the relocation to the given instruction. */
1509 insn = elf_hppa_relocate_insn (insn, value, r_type);
1513 case R_PARISC_PCREL22F:
1514 case R_PARISC_PCREL17F:
1515 case R_PARISC_PCREL22C:
1516 case R_PARISC_PCREL17C:
1517 case R_PARISC_PCREL17R:
1519 /* If this is a call to a function defined in another dynamic
1520 library, then redirect the call to the local stub for this
1522 if (sym_sec == NULL || sym_sec->output_section == NULL)
1523 value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
1524 + hppa_info->stub_sec->output_section->vma);
1526 /* Turn VALUE into a proper PC relative address. */
1527 value -= (offset + input_section->output_offset
1528 + input_section->output_section->vma);
1530 /* Adjust for any field selectors. */
1531 if (r_type == R_PARISC_PCREL17R)
1532 value = hppa_field_adjust (value, -8 + addend, e_rsel);
1534 value = hppa_field_adjust (value, -8 + addend, e_fsel);
1536 /* All branches are implicitly shifted by 2 places. */
1539 /* Apply the relocation to the given instruction. */
1540 insn = elf_hppa_relocate_insn (insn, value, r_type);
1544 /* Indirect references to data through the DLT. */
1545 case R_PARISC_DLTIND14R:
1546 case R_PARISC_DLTIND14F:
1547 case R_PARISC_DLTIND14DR:
1548 case R_PARISC_DLTIND14WR:
1549 case R_PARISC_DLTIND21L:
1550 case R_PARISC_LTOFF_FPTR14R:
1551 case R_PARISC_LTOFF_FPTR14DR:
1552 case R_PARISC_LTOFF_FPTR14WR:
1553 case R_PARISC_LTOFF_FPTR21L:
1554 case R_PARISC_LTOFF_FPTR16F:
1555 case R_PARISC_LTOFF_FPTR16WF:
1556 case R_PARISC_LTOFF_FPTR16DF:
1557 case R_PARISC_LTOFF_TP21L:
1558 case R_PARISC_LTOFF_TP14R:
1559 case R_PARISC_LTOFF_TP14F:
1560 case R_PARISC_LTOFF_TP14WR:
1561 case R_PARISC_LTOFF_TP14DR:
1562 case R_PARISC_LTOFF_TP16F:
1563 case R_PARISC_LTOFF_TP16WF:
1564 case R_PARISC_LTOFF_TP16DF:
1565 case R_PARISC_LTOFF16F:
1566 case R_PARISC_LTOFF16WF:
1567 case R_PARISC_LTOFF16DF:
1569 /* If this relocation was against a local symbol, then we still
1570 have not set up the DLT entry (it's not convenient to do so
1571 in the "finalize_dlt" routine because it is difficult to get
1572 to the local symbol's value).
1574 So, if this is a local symbol (h == NULL), then we need to
1575 fill in its DLT entry.
1577 Similarly we may still need to set up an entry in .opd for
1578 a local function which had its address taken. */
1579 if (dyn_h->h == NULL)
1581 bfd_put_64 (hppa_info->dlt_sec->owner,
1583 hppa_info->dlt_sec->contents + dyn_h->dlt_offset);
1585 /* Now handle .opd creation if needed. */
1586 if (r_type == R_PARISC_LTOFF_FPTR14R
1587 || r_type == R_PARISC_LTOFF_FPTR14DR
1588 || r_type == R_PARISC_LTOFF_FPTR14WR
1589 || r_type == R_PARISC_LTOFF_FPTR21L
1590 || r_type == R_PARISC_LTOFF_FPTR16F
1591 || r_type == R_PARISC_LTOFF_FPTR16WF
1592 || r_type == R_PARISC_LTOFF_FPTR16DF)
1594 /* The first two words of an .opd entry are zero. */
1595 memset (hppa_info->opd_sec->contents + dyn_h->opd_offset,
1598 /* The next word is the address of the function. */
1599 bfd_put_64 (hppa_info->opd_sec->owner, value,
1600 (hppa_info->opd_sec->contents
1601 + dyn_h->opd_offset + 16));
1603 /* The last word is our local __gp value. */
1604 value = _bfd_get_gp_value
1605 (hppa_info->opd_sec->output_section->owner);
1606 bfd_put_64 (hppa_info->opd_sec->owner, value,
1607 (hppa_info->opd_sec->contents
1608 + dyn_h->opd_offset + 24));
1612 /* We want the value of the DLT offset for this symbol, not
1613 the symbol's actual address. Note that __gp may not point
1614 to the start of the DLT, so we have to compute the absolute
1615 address, then subtract out the value of __gp. */
1616 value = (dyn_h->dlt_offset
1617 + hppa_info->dlt_sec->output_offset
1618 + hppa_info->dlt_sec->output_section->vma);
1619 value -= _bfd_get_gp_value (output_bfd);
1621 /* All DLTIND relocations are basically the same at this point,
1622 except that we need different field selectors for the 21bit
1623 version vs the 14bit versions. */
1624 if (r_type == R_PARISC_DLTIND21L
1625 || r_type == R_PARISC_LTOFF_FPTR21L
1626 || r_type == R_PARISC_LTOFF_TP21L)
1627 value = hppa_field_adjust (value, addend, e_lrsel);
1628 else if (r_type == R_PARISC_DLTIND14F
1629 || r_type == R_PARISC_LTOFF_FPTR16F
1630 || r_type == R_PARISC_LTOFF_FPTR16WF
1631 || r_type == R_PARISC_LTOFF_FPTR16DF
1632 || r_type == R_PARISC_LTOFF16F
1633 || r_type == R_PARISC_LTOFF16DF
1634 || r_type == R_PARISC_LTOFF16WF
1635 || r_type == R_PARISC_LTOFF_TP16F
1636 || r_type == R_PARISC_LTOFF_TP16WF
1637 || r_type == R_PARISC_LTOFF_TP16DF)
1638 value = hppa_field_adjust (value, addend, e_fsel);
1640 value = hppa_field_adjust (value, addend, e_rrsel);
1642 insn = elf_hppa_relocate_insn (insn, value, r_type);
1646 case R_PARISC_DLTREL14R:
1647 case R_PARISC_DLTREL14F:
1648 case R_PARISC_DLTREL14DR:
1649 case R_PARISC_DLTREL14WR:
1650 case R_PARISC_DLTREL21L:
1651 case R_PARISC_DPREL21L:
1652 case R_PARISC_DPREL14WR:
1653 case R_PARISC_DPREL14DR:
1654 case R_PARISC_DPREL14R:
1655 case R_PARISC_DPREL14F:
1656 case R_PARISC_GPREL16F:
1657 case R_PARISC_GPREL16WF:
1658 case R_PARISC_GPREL16DF:
1660 /* Subtract out the global pointer value to make value a DLT
1661 relative address. */
1662 value -= _bfd_get_gp_value (output_bfd);
1664 /* All DLTREL relocations are basically the same at this point,
1665 except that we need different field selectors for the 21bit
1666 version vs the 14bit versions. */
1667 if (r_type == R_PARISC_DLTREL21L
1668 || r_type == R_PARISC_DPREL21L)
1669 value = hppa_field_adjust (value, addend, e_lrsel);
1670 else if (r_type == R_PARISC_DLTREL14F
1671 || r_type == R_PARISC_DPREL14F
1672 || r_type == R_PARISC_GPREL16F
1673 || r_type == R_PARISC_GPREL16WF
1674 || r_type == R_PARISC_GPREL16DF)
1675 value = hppa_field_adjust (value, addend, e_fsel);
1677 value = hppa_field_adjust (value, addend, e_rrsel);
1679 insn = elf_hppa_relocate_insn (insn, value, r_type);
1683 case R_PARISC_DIR21L:
1684 case R_PARISC_DIR17R:
1685 case R_PARISC_DIR17F:
1686 case R_PARISC_DIR14R:
1687 case R_PARISC_DIR14WR:
1688 case R_PARISC_DIR14DR:
1689 case R_PARISC_DIR16F:
1690 case R_PARISC_DIR16WF:
1691 case R_PARISC_DIR16DF:
1693 /* All DIR relocations are basically the same at this point,
1694 except that branch offsets need to be divided by four, and
1695 we need different field selectors. Note that we don't
1696 redirect absolute calls to local stubs. */
1698 if (r_type == R_PARISC_DIR21L)
1699 value = hppa_field_adjust (value, addend, e_lrsel);
1700 else if (r_type == R_PARISC_DIR17F
1701 || r_type == R_PARISC_DIR16F
1702 || r_type == R_PARISC_DIR16WF
1703 || r_type == R_PARISC_DIR16DF)
1704 value = hppa_field_adjust (value, addend, e_fsel);
1706 value = hppa_field_adjust (value, addend, e_rrsel);
1708 if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F)
1710 /* All branches are implicitly shifted by 2 places. */
1714 insn = elf_hppa_relocate_insn (insn, value, r_type);
1718 case R_PARISC_PLTOFF21L:
1719 case R_PARISC_PLTOFF14R:
1720 case R_PARISC_PLTOFF14F:
1721 case R_PARISC_PLTOFF14WR:
1722 case R_PARISC_PLTOFF14DR:
1723 case R_PARISC_PLTOFF16F:
1724 case R_PARISC_PLTOFF16WF:
1725 case R_PARISC_PLTOFF16DF:
1727 /* We want the value of the PLT offset for this symbol, not
1728 the symbol's actual address. Note that __gp may not point
1729 to the start of the DLT, so we have to compute the absolute
1730 address, then subtract out the value of __gp. */
1731 value = (dyn_h->plt_offset
1732 + hppa_info->plt_sec->output_offset
1733 + hppa_info->plt_sec->output_section->vma);
1734 value -= _bfd_get_gp_value (output_bfd);
1736 /* All PLTOFF relocations are basically the same at this point,
1737 except that we need different field selectors for the 21bit
1738 version vs the 14bit versions. */
1739 if (r_type == R_PARISC_PLTOFF21L)
1740 value = hppa_field_adjust (value, addend, e_lrsel);
1741 else if (r_type == R_PARISC_PLTOFF14F
1742 || r_type == R_PARISC_PLTOFF16F
1743 || r_type == R_PARISC_PLTOFF16WF
1744 || r_type == R_PARISC_PLTOFF16DF)
1745 value = hppa_field_adjust (value, addend, e_fsel);
1747 value = hppa_field_adjust (value, addend, e_rrsel);
1749 insn = elf_hppa_relocate_insn (insn, value, r_type);
1753 case R_PARISC_LTOFF_FPTR32:
1755 /* We may still need to create the FPTR itself if it was for
1757 if (dyn_h->h == NULL)
1759 /* The first two words of an .opd entry are zero. */
1760 memset (hppa_info->opd_sec->contents + dyn_h->opd_offset, 0, 16);
1762 /* The next word is the address of the function. */
1763 bfd_put_64 (hppa_info->opd_sec->owner, value,
1764 (hppa_info->opd_sec->contents
1765 + dyn_h->opd_offset + 16));
1767 /* The last word is our local __gp value. */
1768 value = _bfd_get_gp_value
1769 (hppa_info->opd_sec->output_section->owner);
1770 bfd_put_64 (hppa_info->opd_sec->owner, value,
1771 hppa_info->opd_sec->contents + dyn_h->opd_offset + 24);
1774 /* We want the value of the DLT offset for this symbol, not
1775 the symbol's actual address. Note that __gp may not point
1776 to the start of the DLT, so we have to compute the absolute
1777 address, then subtract out the value of __gp. */
1778 value = (dyn_h->dlt_offset
1779 + hppa_info->dlt_sec->output_offset
1780 + hppa_info->dlt_sec->output_section->vma);
1781 value -= _bfd_get_gp_value (output_bfd);
1782 bfd_put_32 (input_bfd, value, hit_data);
1783 return bfd_reloc_ok;
1786 case R_PARISC_LTOFF_FPTR64:
1787 case R_PARISC_LTOFF_TP64:
1789 /* We may still need to create the FPTR itself if it was for
1791 if (dyn_h->h == NULL && r_type == R_PARISC_LTOFF_FPTR64)
1793 /* The first two words of an .opd entry are zero. */
1794 memset (hppa_info->opd_sec->contents + dyn_h->opd_offset, 0, 16);
1796 /* The next word is the address of the function. */
1797 bfd_put_64 (hppa_info->opd_sec->owner, value,
1798 (hppa_info->opd_sec->contents
1799 + dyn_h->opd_offset + 16));
1801 /* The last word is our local __gp value. */
1802 value = _bfd_get_gp_value
1803 (hppa_info->opd_sec->output_section->owner);
1804 bfd_put_64 (hppa_info->opd_sec->owner, value,
1805 hppa_info->opd_sec->contents + dyn_h->opd_offset + 24);
1808 /* We want the value of the DLT offset for this symbol, not
1809 the symbol's actual address. Note that __gp may not point
1810 to the start of the DLT, so we have to compute the absolute
1811 address, then subtract out the value of __gp. */
1812 value = (dyn_h->dlt_offset
1813 + hppa_info->dlt_sec->output_offset
1814 + hppa_info->dlt_sec->output_section->vma);
1815 value -= _bfd_get_gp_value (output_bfd);
1816 bfd_put_64 (input_bfd, value, hit_data);
1817 return bfd_reloc_ok;
1820 case R_PARISC_DIR32:
1821 bfd_put_32 (input_bfd, value + addend, hit_data);
1822 return bfd_reloc_ok;
1824 case R_PARISC_DIR64:
1825 bfd_put_64 (input_bfd, value + addend, hit_data);
1826 return bfd_reloc_ok;
1828 case R_PARISC_GPREL64:
1829 /* Subtract out the global pointer value to make value a DLT
1830 relative address. */
1831 value -= _bfd_get_gp_value (output_bfd);
1833 bfd_put_64 (input_bfd, value + addend, hit_data);
1834 return bfd_reloc_ok;
1836 case R_PARISC_LTOFF64:
1837 /* We want the value of the DLT offset for this symbol, not
1838 the symbol's actual address. Note that __gp may not point
1839 to the start of the DLT, so we have to compute the absolute
1840 address, then subtract out the value of __gp. */
1841 value = (dyn_h->dlt_offset
1842 + hppa_info->dlt_sec->output_offset
1843 + hppa_info->dlt_sec->output_section->vma);
1844 value -= _bfd_get_gp_value (output_bfd);
1846 bfd_put_64 (input_bfd, value + addend, hit_data);
1847 return bfd_reloc_ok;
1849 case R_PARISC_PCREL32:
1851 /* If this is a call to a function defined in another dynamic
1852 library, then redirect the call to the local stub for this
1854 if (sym_sec == NULL || sym_sec->output_section == NULL)
1855 value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
1856 + hppa_info->stub_sec->output_section->vma);
1858 /* Turn VALUE into a proper PC relative address. */
1859 value -= (offset + input_section->output_offset
1860 + input_section->output_section->vma);
1864 bfd_put_32 (input_bfd, value, hit_data);
1865 return bfd_reloc_ok;
1868 case R_PARISC_PCREL64:
1870 /* If this is a call to a function defined in another dynamic
1871 library, then redirect the call to the local stub for this
1873 if (sym_sec == NULL || sym_sec->output_section == NULL)
1874 value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
1875 + hppa_info->stub_sec->output_section->vma);
1878 /* Turn VALUE into a proper PC relative address. */
1879 value -= (offset + input_section->output_offset
1880 + input_section->output_section->vma);
1884 bfd_put_64 (input_bfd, value, hit_data);
1885 return bfd_reloc_ok;
1889 case R_PARISC_FPTR64:
1891 /* We may still need to create the FPTR itself if it was for
1893 if (dyn_h->h == NULL)
1895 /* The first two words of an .opd entry are zero. */
1896 memset (hppa_info->opd_sec->contents + dyn_h->opd_offset, 0, 16);
1898 /* The next word is the address of the function. */
1899 bfd_put_64 (hppa_info->opd_sec->owner, value,
1900 (hppa_info->opd_sec->contents
1901 + dyn_h->opd_offset + 16));
1903 /* The last word is our local __gp value. */
1904 value = _bfd_get_gp_value
1905 (hppa_info->opd_sec->output_section->owner);
1906 bfd_put_64 (hppa_info->opd_sec->owner, value,
1907 hppa_info->opd_sec->contents + dyn_h->opd_offset + 24);
1910 /* We want the value of the OPD offset for this symbol, not
1911 the symbol's actual address. */
1912 value = (dyn_h->opd_offset
1913 + hppa_info->opd_sec->output_offset
1914 + hppa_info->opd_sec->output_section->vma);
1916 bfd_put_64 (input_bfd, value + addend, hit_data);
1917 return bfd_reloc_ok;
1920 case R_PARISC_SECREL32:
1921 bfd_put_32 (input_bfd,
1922 value + addend - sym_sec->output_section->vma,
1924 return bfd_reloc_ok;
1926 case R_PARISC_SEGREL32:
1927 case R_PARISC_SEGREL64:
1929 /* If this is the first SEGREL relocation, then initialize
1930 the segment base values. */
1931 if (hppa_info->text_segment_base == (bfd_vma) -1)
1932 bfd_map_over_sections (output_bfd, elf_hppa_record_segment_addrs,
1935 /* VALUE holds the absolute address. We want to include the
1936 addend, then turn it into a segment relative address.
1938 The segment is derived from SYM_SEC. We assume that there are
1939 only two segments of note in the resulting executable/shlib.
1940 A readonly segment (.text) and a readwrite segment (.data). */
1943 if (sym_sec->flags & SEC_CODE)
1944 value -= hppa_info->text_segment_base;
1946 value -= hppa_info->data_segment_base;
1948 if (r_type == R_PARISC_SEGREL32)
1949 bfd_put_32 (input_bfd, value, hit_data);
1951 bfd_put_64 (input_bfd, value, hit_data);
1952 return bfd_reloc_ok;
1956 /* Something we don't know how to handle. */
1958 return bfd_reloc_notsupported;
1961 /* Update the instruction word. */
1962 bfd_put_32 (input_bfd, insn, hit_data);
1963 return bfd_reloc_ok;
1966 /* Relocate the given INSN. VALUE should be the actual value we want
1967 to insert into the instruction, ie by this point we should not be
1968 concerned with computing an offset relative to the DLT, PC, etc.
1969 Instead this routine is meant to handle the bit manipulations needed
1970 to insert the relocation into the given instruction. */
1973 elf_hppa_relocate_insn (insn, sym_value, r_type)
1975 unsigned int sym_value;
1976 unsigned int r_type;
1980 /* This is any 22bit branch. In PA2.0 syntax it corresponds to
1981 the "B" instruction. */
1982 case R_PARISC_PCREL22F:
1983 case R_PARISC_PCREL22C:
1984 return (insn & ~ 0x3ff1ffd) | re_assemble_22 (sym_value);
1986 /* This is any 17bit branch. In PA2.0 syntax it also corresponds to
1987 the "B" instruction as well as BE. */
1988 case R_PARISC_PCREL17F:
1989 case R_PARISC_DIR17F:
1990 case R_PARISC_DIR17R:
1991 case R_PARISC_PCREL17C:
1992 case R_PARISC_PCREL17R:
1993 return (insn & ~ 0x1f1ffd) | re_assemble_17 (sym_value);
1995 /* ADDIL or LDIL instructions. */
1996 case R_PARISC_DLTREL21L:
1997 case R_PARISC_DLTIND21L:
1998 case R_PARISC_LTOFF_FPTR21L:
1999 case R_PARISC_PCREL21L:
2000 case R_PARISC_LTOFF_TP21L:
2001 case R_PARISC_DPREL21L:
2002 case R_PARISC_PLTOFF21L:
2003 case R_PARISC_DIR21L:
2004 return (insn & ~ 0x1fffff) | re_assemble_21 (sym_value);
2006 /* LDO and integer loads/stores with 14bit displacements. */
2007 case R_PARISC_DLTREL14R:
2008 case R_PARISC_DLTREL14F:
2009 case R_PARISC_DLTIND14R:
2010 case R_PARISC_DLTIND14F:
2011 case R_PARISC_LTOFF_FPTR14R:
2012 case R_PARISC_LTOFF_FPTR16F:
2013 case R_PARISC_PCREL14R:
2014 case R_PARISC_PCREL14F:
2015 case R_PARISC_PCREL16F:
2016 case R_PARISC_LTOFF_TP14R:
2017 case R_PARISC_LTOFF_TP14F:
2018 case R_PARISC_LTOFF_TP16F:
2019 case R_PARISC_DPREL14R:
2020 case R_PARISC_DPREL14F:
2021 case R_PARISC_GPREL16F:
2022 case R_PARISC_PLTOFF14R:
2023 case R_PARISC_PLTOFF14F:
2024 case R_PARISC_PLTOFF16F:
2025 case R_PARISC_DIR14R:
2026 case R_PARISC_DIR16F:
2027 case R_PARISC_LTOFF16F:
2028 return (insn & ~ 0x3fff) | low_sign_unext (sym_value, 14);
2030 /* Doubleword loads and stores with a 14bit displacement. */
2031 case R_PARISC_DLTREL14DR:
2032 case R_PARISC_DLTIND14DR:
2033 case R_PARISC_LTOFF_FPTR14DR:
2034 case R_PARISC_LTOFF_FPTR16DF:
2035 case R_PARISC_PCREL14DR:
2036 case R_PARISC_PCREL16DF:
2037 case R_PARISC_LTOFF_TP14DR:
2038 case R_PARISC_LTOFF_TP16DF:
2039 case R_PARISC_DPREL14DR:
2040 case R_PARISC_GPREL16DF:
2041 case R_PARISC_PLTOFF14DR:
2042 case R_PARISC_PLTOFF16DF:
2043 case R_PARISC_DIR14DR:
2044 case R_PARISC_DIR16DF:
2045 case R_PARISC_LTOFF16DF:
2046 return (insn & ~ 0x3ff1) | (((sym_value & 0x2000) >> 13)
2047 | ((sym_value & 0x1ff8) << 1));
2049 /* Floating point single word load/store instructions. */
2050 case R_PARISC_DLTREL14WR:
2051 case R_PARISC_DLTIND14WR:
2052 case R_PARISC_LTOFF_FPTR14WR:
2053 case R_PARISC_LTOFF_FPTR16WF:
2054 case R_PARISC_PCREL14WR:
2055 case R_PARISC_PCREL16WF:
2056 case R_PARISC_LTOFF_TP14WR:
2057 case R_PARISC_LTOFF_TP16WF:
2058 case R_PARISC_DPREL14WR:
2059 case R_PARISC_GPREL16WF:
2060 case R_PARISC_PLTOFF14WR:
2061 case R_PARISC_PLTOFF16WF:
2062 case R_PARISC_DIR16WF:
2063 case R_PARISC_DIR14WR:
2064 case R_PARISC_LTOFF16WF:
2065 return (insn & ~ 0x3ff9) | (((sym_value & 0x2000) >> 13)
2066 | ((sym_value & 0x1ffc) << 1));