1 /* Common code for PA ELF implementations.
2 Copyright 1999, 2000, 2001 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
*));
65 static void elf_hppa_final_write_processing
66 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 int elf_hppa_relocate_insn
96 PARAMS ((int, int, unsigned int));
99 /* ELF/PA relocation howto entries. */
101 static reloc_howto_type elf_hppa_howto_table
[ELF_HOWTO_TABLE_SIZE
] =
103 { R_PARISC_NONE
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
104 bfd_elf_generic_reloc
, "R_PARISC_NONE", false, 0, 0, false },
106 /* The values in DIR32 are to placate the check in
107 _bfd_stab_section_find_nearest_line. */
108 { R_PARISC_DIR32
, 0, 2, 32, false, 0, complain_overflow_bitfield
,
109 bfd_elf_generic_reloc
, "R_PARISC_DIR32", false, 0, 0xffffffff, false },
110 { R_PARISC_DIR21L
, 0, 0, 21, false, 0, complain_overflow_bitfield
,
111 bfd_elf_generic_reloc
, "R_PARISC_DIR21L", false, 0, 0, false },
112 { R_PARISC_DIR17R
, 0, 0, 17, false, 0, complain_overflow_bitfield
,
113 bfd_elf_generic_reloc
, "R_PARISC_DIR17R", false, 0, 0, false },
114 { R_PARISC_DIR17F
, 0, 0, 17, false, 0, complain_overflow_bitfield
,
115 bfd_elf_generic_reloc
, "R_PARISC_DIR17F", 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 },
118 { R_PARISC_DIR14R
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
119 bfd_elf_generic_reloc
, "R_PARISC_DIR14R", false, 0, 0, false },
120 { R_PARISC_DIR14F
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
121 bfd_elf_generic_reloc
, "R_PARISC_DIR14F", false, 0, 0, false },
123 { R_PARISC_PCREL12F
, 0, 0, 12, true, 0, complain_overflow_bitfield
,
124 bfd_elf_generic_reloc
, "R_PARISC_PCREL12F", 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 },
127 { R_PARISC_PCREL21L
, 0, 0, 21, true, 0, complain_overflow_bitfield
,
128 bfd_elf_generic_reloc
, "R_PARISC_PCREL21L", false, 0, 0, false },
129 { R_PARISC_PCREL17R
, 0, 0, 17, true, 0, complain_overflow_bitfield
,
130 bfd_elf_generic_reloc
, "R_PARISC_PCREL17R", false, 0, 0, false },
131 { R_PARISC_PCREL17F
, 0, 0, 17, true, 0, complain_overflow_bitfield
,
132 bfd_elf_generic_reloc
, "R_PARISC_PCREL17F", false, 0, 0, false },
133 { R_PARISC_PCREL17C
, 0, 0, 17, true, 0, complain_overflow_bitfield
,
134 bfd_elf_generic_reloc
, "R_PARISC_PCREL17C", false, 0, 0, false },
135 { R_PARISC_PCREL14R
, 0, 0, 14, true, 0, complain_overflow_bitfield
,
136 bfd_elf_generic_reloc
, "R_PARISC_PCREL14R", false, 0, 0, false },
137 { R_PARISC_PCREL14F
, 0, 0, 14, true, 0, complain_overflow_bitfield
,
138 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, 14, false, 0, complain_overflow_bitfield
,
147 bfd_elf_generic_reloc
, "R_PARISC_DPREL14WR", false, 0, 0, false },
148 { R_PARISC_DPREL14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
149 bfd_elf_generic_reloc
, "R_PARISC_DPREL14DR", 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 },
152 { R_PARISC_DPREL14R
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
153 bfd_elf_generic_reloc
, "R_PARISC_DPREL14R", false, 0, 0, false },
154 { R_PARISC_DPREL14F
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
155 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 },
169 { R_PARISC_DLTREL14R
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
170 bfd_elf_generic_reloc
, "R_PARISC_DLTREL14R", false, 0, 0, false },
171 { R_PARISC_DLTREL14F
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
172 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, 32, 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 },
208 { R_PARISC_SEGBASE
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
209 bfd_elf_generic_reloc
, "R_PARISC_SEGBASE", false, 0, 0, false },
210 { R_PARISC_SEGREL32
, 0, 0, 32, false, 0, complain_overflow_bitfield
,
211 bfd_elf_generic_reloc
, "R_PARISC_SEGREL32", false, 0, 0, false },
212 { R_PARISC_PLTOFF21L
, 0, 0, 21, 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, 14, false, 0, complain_overflow_bitfield
,
221 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF14R", false, 0, 0, false },
222 { R_PARISC_PLTOFF14F
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
223 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF14F", false, 0, 0, false },
225 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
226 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
227 { R_PARISC_LTOFF_FPTR32
, 0, 0, 32, false, 0, complain_overflow_bitfield
,
228 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_FPTR32", false, 0, 0, false },
229 { R_PARISC_LTOFF_FPTR21L
, 0, 0, 21, false, 0, complain_overflow_bitfield
,
230 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_FPTR21L", false, 0, 0, false },
231 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
232 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, 14, 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 },
242 { R_PARISC_FPTR64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
243 bfd_elf_generic_reloc
, "R_PARISC_FPTR64", false, 0, 0, false },
244 { R_PARISC_PLABEL32
, 0, 0, 32, false, 0, complain_overflow_bitfield
,
245 bfd_elf_generic_reloc
, "R_PARISC_PLABEL32", false, 0, 0, false },
246 { R_PARISC_PLABEL21L
, 0, 0, 21, false, 0, complain_overflow_bitfield
,
247 bfd_elf_generic_reloc
, "R_PARISC_PLABEL21L", false, 0, 0, false },
248 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
249 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
250 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
251 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
252 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
253 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 },
259 { R_PARISC_PCREL64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
260 bfd_elf_generic_reloc
, "R_PARISC_PCREL64", false, 0, 0, false },
261 { R_PARISC_PCREL22C
, 0, 0, 22, false, 0, complain_overflow_bitfield
,
262 bfd_elf_generic_reloc
, "R_PARISC_PCREL22C", false, 0, 0, false },
263 { R_PARISC_PCREL22F
, 0, 0, 22, false, 0, complain_overflow_bitfield
,
264 bfd_elf_generic_reloc
, "R_PARISC_PCREL22F", false, 0, 0, false },
265 { R_PARISC_PCREL14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
266 bfd_elf_generic_reloc
, "R_PARISC_PCREL14WR", false, 0, 0, false },
267 { R_PARISC_PCREL14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
268 bfd_elf_generic_reloc
, "R_PARISC_PCREL14DR", false, 0, 0, false },
269 { R_PARISC_PCREL16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
270 bfd_elf_generic_reloc
, "R_PARISC_PCREL16F", false, 0, 0, false },
271 { R_PARISC_PCREL16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
272 bfd_elf_generic_reloc
, "R_PARISC_PCREL16WF", false, 0, 0, false },
273 { R_PARISC_PCREL16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
274 bfd_elf_generic_reloc
, "R_PARISC_PCREL16DF", false, 0, 0, false },
276 { R_PARISC_DIR64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
277 bfd_elf_generic_reloc
, "R_PARISC_DIR64", 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 },
280 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
281 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
282 { R_PARISC_DIR14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
283 bfd_elf_generic_reloc
, "R_PARISC_DIR14WR", false, 0, 0, false },
284 { R_PARISC_DIR14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
285 bfd_elf_generic_reloc
, "R_PARISC_DIR14DR", false, 0, 0, false },
286 { R_PARISC_DIR16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
287 bfd_elf_generic_reloc
, "R_PARISC_DIR16F", false, 0, 0, false },
288 { R_PARISC_DIR16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
289 bfd_elf_generic_reloc
, "R_PARISC_DIR16WF", false, 0, 0, false },
290 { R_PARISC_DIR16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
291 bfd_elf_generic_reloc
, "R_PARISC_DIR16DF", false, 0, 0, false },
293 { R_PARISC_GPREL64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
294 bfd_elf_generic_reloc
, "R_PARISC_GPREL64", 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 },
299 { R_PARISC_DLTREL14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
300 bfd_elf_generic_reloc
, "R_PARISC_DLTREL14WR", false, 0, 0, false },
301 { R_PARISC_DLTREL14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
302 bfd_elf_generic_reloc
, "R_PARISC_DLTREL14DR", false, 0, 0, false },
303 { R_PARISC_GPREL16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
304 bfd_elf_generic_reloc
, "R_PARISC_GPREL16F", false, 0, 0, false },
305 { R_PARISC_GPREL16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
306 bfd_elf_generic_reloc
, "R_PARISC_GPREL16WF", false, 0, 0, false },
307 { R_PARISC_GPREL16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
308 bfd_elf_generic_reloc
, "R_PARISC_GPREL16DF", false, 0, 0, false },
310 { R_PARISC_LTOFF64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
311 bfd_elf_generic_reloc
, "R_PARISC_LTOFF64", 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 },
316 { R_PARISC_DLTIND14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
317 bfd_elf_generic_reloc
, "R_PARISC_DLTIND14WR", false, 0, 0, false },
318 { R_PARISC_DLTIND14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
319 bfd_elf_generic_reloc
, "R_PARISC_DLTIND14DR", false, 0, 0, false },
320 { R_PARISC_LTOFF16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
321 bfd_elf_generic_reloc
, "R_PARISC_LTOFF16F", false, 0, 0, false },
322 { R_PARISC_LTOFF16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
323 bfd_elf_generic_reloc
, "R_PARISC_LTOFF16DF", false, 0, 0, false },
324 { R_PARISC_LTOFF16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
325 bfd_elf_generic_reloc
, "R_PARISC_LTOFF16DF", 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_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
330 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
331 { R_PARISC_BASEREL14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
332 bfd_elf_generic_reloc
, "R_PARISC_BASEREL14WR", false, 0, 0, false },
333 { R_PARISC_BASEREL14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
334 bfd_elf_generic_reloc
, "R_PARISC_BASEREL14DR", 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 },
344 { R_PARISC_SEGREL64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
345 bfd_elf_generic_reloc
, "R_PARISC_SEGREL64", 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_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
349 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
350 { R_PARISC_PLTOFF14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
351 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF14WR", false, 0, 0, false },
352 { R_PARISC_PLTOFF14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
353 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF14DR", false, 0, 0, false },
354 { R_PARISC_PLTOFF16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
355 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF16F", false, 0, 0, false },
356 { R_PARISC_PLTOFF16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
357 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF16WF", false, 0, 0, false },
358 { R_PARISC_PLTOFF16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
359 bfd_elf_generic_reloc
, "R_PARISC_PLTOFF16DF", false, 0, 0, false },
361 { R_PARISC_LTOFF_FPTR64
, 0, 0, 64, 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_LTOFF_FPTR14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
368 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_FPTR14WR", false, 0, 0, false },
369 { R_PARISC_LTOFF_FPTR14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
370 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_FPTR14DR", false, 0, 0, false },
371 { R_PARISC_LTOFF_FPTR16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
372 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_FPTR16F", false, 0, 0, false },
373 { R_PARISC_LTOFF_FPTR16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
374 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_FPTR16WF", false, 0, 0, false },
375 { R_PARISC_LTOFF_FPTR16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
376 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
378 { R_PARISC_COPY
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
379 bfd_elf_generic_reloc
, "R_PARISC_COPY", false, 0, 0, false },
380 { R_PARISC_IPLT
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
381 bfd_elf_generic_reloc
, "R_PARISC_IPLT", false, 0, 0, false },
382 { R_PARISC_EPLT
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
383 bfd_elf_generic_reloc
, "R_PARISC_EPLT", 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 },
395 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
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 },
399 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
400 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
401 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
402 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
403 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
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 },
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_dont
,
425 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
426 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
427 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
429 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
430 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
431 { R_PARISC_TPREL32
, 0, 0, 32, false, 0, complain_overflow_dont
,
432 bfd_elf_generic_reloc
, "R_PARISC_TPREL32", false, 0, 0, false },
433 { R_PARISC_TPREL21L
, 0, 0, 21, false, 0, complain_overflow_dont
,
434 bfd_elf_generic_reloc
, "R_PARISC_TPREL21L", false, 0, 0, false },
435 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
436 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
437 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
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_TPREL14R
, 0, 0, 14, false, 0, complain_overflow_dont
,
442 bfd_elf_generic_reloc
, "R_PARISC_TPREL14R", false, 0, 0, false },
443 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
444 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
446 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
447 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
448 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
449 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
450 { R_PARISC_LTOFF_TP21L
, 0, 0, 21, false, 0, complain_overflow_bitfield
,
451 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP21L", false, 0, 0, false },
452 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
453 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
454 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
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_LTOFF_TP14R
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
459 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
460 { R_PARISC_LTOFF_TP14F
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
461 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP14F", false, 0, 0, false },
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_dont
,
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_bitfield
,
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 },
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_bitfield
,
483 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
484 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
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_dont
,
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 },
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_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_dont
,
512 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_bitfield
,
523 bfd_elf_generic_reloc
, "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 },
526 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_dont
,
527 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
528 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
529 bfd_elf_generic_reloc
, "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_dont
,
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_bitfield
,
544 bfd_elf_generic_reloc
, "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_dont
,
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_bitfield
,
553 bfd_elf_generic_reloc
, "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_dont
,
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_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
561 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", 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 },
565 { R_PARISC_TPREL64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
566 bfd_elf_generic_reloc
, "R_PARISC_TPREL64", false, 0, 0, false },
567 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
568 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
569 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
570 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
571 { R_PARISC_TPREL14WR
, 0, 0, 14, false, 0, complain_overflow_dont
,
572 bfd_elf_generic_reloc
, "R_PARISC_TPREL14WR", false, 0, 0, false },
573 { R_PARISC_TPREL14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
574 bfd_elf_generic_reloc
, "R_PARISC_TPREL14DR", false, 0, 0, false },
575 { R_PARISC_TPREL16F
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
576 bfd_elf_generic_reloc
, "R_PARISC_TPREL16F", false, 0, 0, false },
577 { R_PARISC_TPREL16WF
, 0, 0, 16, false, 0, complain_overflow_dont
,
578 bfd_elf_generic_reloc
, "R_PARISC_TPREL16WF", false, 0, 0, false },
579 { R_PARISC_TPREL16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
580 bfd_elf_generic_reloc
, "R_PARISC_TPREL16DF", false, 0, 0, false },
582 { R_PARISC_LTOFF_TP64
, 0, 0, 64, false, 0, complain_overflow_bitfield
,
583 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP64", false, 0, 0, false },
584 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
585 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
586 { R_PARISC_UNIMPLEMENTED
, 0, 0, 0, false, 0, complain_overflow_bitfield
,
587 bfd_elf_generic_reloc
, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
588 { R_PARISC_LTOFF_TP14WR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
589 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP14WR", false, 0, 0, false },
590 { R_PARISC_LTOFF_TP14DR
, 0, 0, 14, false, 0, complain_overflow_bitfield
,
591 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP14DR", false, 0, 0, false },
592 { R_PARISC_LTOFF_TP16F
, 0, 0, 16, false, 0, complain_overflow_dont
,
593 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP16F", false, 0, 0, false },
594 { R_PARISC_LTOFF_TP16WF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
595 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP16WF", false, 0, 0, false },
596 { R_PARISC_LTOFF_TP16DF
, 0, 0, 16, false, 0, complain_overflow_bitfield
,
597 bfd_elf_generic_reloc
, "R_PARISC_LTOFF_TP16DF", false, 0, 0, false },
599 { R_PARISC_GNU_VTENTRY
, 0, 0, 0, false, 0, complain_overflow_dont
,
600 bfd_elf_generic_reloc
, "R_PARISC_GNU_VTENTRY", false, 0, 0, false },
601 { R_PARISC_GNU_VTINHERIT
, 0, 0, 0, false, 0, complain_overflow_dont
,
602 bfd_elf_generic_reloc
, "R_PARISC_GNU_VTINHERIT", false, 0, 0, false },
605 #define OFFSET_14R_FROM_21L 4
606 #define OFFSET_14F_FROM_21L 5
608 /* Return one (or more) BFD relocations which implement the base
609 relocation with modifications based on format and field. */
611 elf_hppa_reloc_type
**
612 _bfd_elf_hppa_gen_reloc_type (abfd
, base_type
, format
, field
, ignore
, sym
)
614 elf_hppa_reloc_type base_type
;
617 int ignore ATTRIBUTE_UNUSED
;
618 asymbol
*sym ATTRIBUTE_UNUSED
;
620 elf_hppa_reloc_type
*finaltype
;
621 elf_hppa_reloc_type
**final_types
;
622 bfd_size_type amt
= sizeof (elf_hppa_reloc_type
*) * 2;
624 /* Allocate slots for the BFD relocation. */
625 final_types
= (elf_hppa_reloc_type
**) bfd_alloc (abfd
, amt
);
626 if (final_types
== NULL
)
629 /* Allocate space for the relocation itself. */
630 amt
= sizeof (elf_hppa_reloc_type
);
631 finaltype
= (elf_hppa_reloc_type
*) bfd_alloc (abfd
, amt
);
632 if (finaltype
== NULL
)
635 /* Some reasonable defaults. */
636 final_types
[0] = finaltype
;
637 final_types
[1] = NULL
;
639 #define final_type finaltype[0]
641 final_type
= base_type
;
643 /* Just a tangle of nested switch statements to deal with the braindamage
644 that a different field selector means a completely different relocation
648 /* We have been using generic relocation types. However, that may not
649 really make sense. Anyway, we need to support both R_PARISC_DIR64
650 and R_PARISC_DIR32 here. */
653 case R_HPPA_ABS_CALL
:
660 final_type
= R_PARISC_DIR14F
;
665 final_type
= R_PARISC_DIR14R
;
668 final_type
= R_PARISC_DLTIND14R
;
671 final_type
= R_PARISC_LTOFF_FPTR14DR
;
674 final_type
= R_PARISC_DLTIND14F
;
677 final_type
= R_PARISC_PLABEL14R
;
688 final_type
= R_PARISC_DIR17F
;
693 final_type
= R_PARISC_DIR17R
;
708 final_type
= R_PARISC_DIR21L
;
711 final_type
= R_PARISC_DLTIND21L
;
714 final_type
= R_PARISC_LTOFF_FPTR21L
;
717 final_type
= R_PARISC_PLABEL21L
;
728 final_type
= R_PARISC_DIR32
;
729 /* When in 64bit mode, a 32bit relocation is supposed to
730 be a section relative relocation. Dwarf2 (for example)
731 uses 32bit section relative relocations. */
732 if (bfd_get_arch_info (abfd
)->bits_per_address
!= 32)
733 final_type
= R_PARISC_SECREL32
;
736 final_type
= R_PARISC_PLABEL32
;
747 final_type
= R_PARISC_DIR64
;
750 final_type
= R_PARISC_FPTR64
;
771 /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32 */
772 final_type
= base_type
+ OFFSET_14R_FROM_21L
;
775 /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32 */
776 final_type
= base_type
+ OFFSET_14F_FROM_21L
;
791 /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32 */
792 final_type
= base_type
;
804 case R_HPPA_PCREL_CALL
:
811 final_type
= R_PARISC_PCREL12F
;
819 /* Contrary to appearances, these are not calls of any sort.
820 Rather, they are loads/stores with a pcrel reloc. */
826 final_type
= R_PARISC_PCREL14R
;
829 final_type
= R_PARISC_PCREL14F
;
842 final_type
= R_PARISC_PCREL17R
;
845 final_type
= R_PARISC_PCREL17F
;
860 final_type
= R_PARISC_PCREL21L
;
871 final_type
= R_PARISC_PCREL22F
;
883 case R_PARISC_GNU_VTENTRY
:
884 case R_PARISC_GNU_VTINHERIT
:
885 case R_PARISC_SEGREL32
:
886 case R_PARISC_SEGBASE
:
887 /* The defaults are fine for these cases. */
897 /* Translate from an elf into field into a howto relocation pointer. */
900 elf_hppa_info_to_howto (abfd
, bfd_reloc
, elf_reloc
)
901 bfd
*abfd ATTRIBUTE_UNUSED
;
903 Elf_Internal_Rela
*elf_reloc
;
905 BFD_ASSERT (ELF_R_TYPE(elf_reloc
->r_info
)
906 < (unsigned int) R_PARISC_UNIMPLEMENTED
);
907 bfd_reloc
->howto
= &elf_hppa_howto_table
[ELF_R_TYPE (elf_reloc
->r_info
)];
910 /* Translate from an elf into field into a howto relocation pointer. */
913 elf_hppa_info_to_howto_rel (abfd
, bfd_reloc
, elf_reloc
)
914 bfd
*abfd ATTRIBUTE_UNUSED
;
916 Elf_Internal_Rel
*elf_reloc
;
918 BFD_ASSERT (ELF_R_TYPE(elf_reloc
->r_info
)
919 < (unsigned int) R_PARISC_UNIMPLEMENTED
);
920 bfd_reloc
->howto
= &elf_hppa_howto_table
[ELF_R_TYPE (elf_reloc
->r_info
)];
923 /* Return the address of the howto table entry to perform the CODE
924 relocation for an ARCH machine. */
926 static reloc_howto_type
*
927 elf_hppa_reloc_type_lookup (abfd
, code
)
928 bfd
*abfd ATTRIBUTE_UNUSED
;
929 bfd_reloc_code_real_type code
;
931 if ((int) code
< (int) R_PARISC_UNIMPLEMENTED
)
933 BFD_ASSERT ((int) elf_hppa_howto_table
[(int) code
].type
== (int) code
);
934 return &elf_hppa_howto_table
[(int) code
];
939 /* Return true if SYM represents a local label symbol. */
942 elf_hppa_is_local_label_name (abfd
, name
)
943 bfd
*abfd ATTRIBUTE_UNUSED
;
946 if (name
[0] == 'L' && name
[1] == '$')
948 return _bfd_elf_is_local_label_name (abfd
, name
);
951 /* Set the correct type for an ELF section. We do this by the
952 section name, which is a hack, but ought to work. */
955 elf_hppa_fake_sections (abfd
, hdr
, sec
)
957 elf_hppa_internal_shdr
*hdr
;
960 register const char *name
;
962 name
= bfd_get_section_name (abfd
, sec
);
964 if (strcmp (name
, ".PARISC.unwind") == 0)
969 hdr
->sh_type
= SHT_LOPROC
+ 1;
973 /* ?!? How are unwinds supposed to work for symbols in arbitrary
974 sections? Or what if we have multiple .text sections in a single
975 .o file? HP really messed up on this one.
977 Ugh. We can not use elf_section_data (sec)->this_idx at this
978 point because it is not initialized yet.
980 So we (gasp) recompute it here. Hopefully nobody ever changes the
981 way sections are numbered in elf.c! */
982 for (asec
= abfd
->sections
, indx
= 1; asec
; asec
= asec
->next
, indx
++)
984 if (asec
->name
&& strcmp (asec
->name
, ".text") == 0)
991 /* I have no idea if this is really necessary or what it means. */
998 elf_hppa_final_write_processing (abfd
, linker
)
1000 boolean linker ATTRIBUTE_UNUSED
;
1002 int mach
= bfd_get_mach (abfd
);
1004 elf_elfheader (abfd
)->e_flags
&= ~(EF_PARISC_ARCH
| EF_PARISC_TRAPNIL
1005 | EF_PARISC_EXT
| EF_PARISC_LSB
1006 | EF_PARISC_WIDE
| EF_PARISC_NO_KABP
1007 | EF_PARISC_LAZYSWAP
);
1010 elf_elfheader (abfd
)->e_flags
|= EFA_PARISC_1_0
;
1011 else if (mach
== 11)
1012 elf_elfheader (abfd
)->e_flags
|= EFA_PARISC_1_1
;
1013 else if (mach
== 20)
1014 elf_elfheader (abfd
)->e_flags
|= EFA_PARISC_2_0
;
1015 else if (mach
== 25)
1016 elf_elfheader (abfd
)->e_flags
|= (EF_PARISC_WIDE
1018 /* The GNU tools have trapped without
1019 option since 1993, so need to take
1020 a step backwards with the ELF
1021 based toolchains. */
1022 | EF_PARISC_TRAPNIL
);
1026 /* Hook called by the linker routine which adds symbols from an object
1027 file. HP's libraries define symbols with HP specific section
1028 indices, which we have to handle. */
1031 elf_hppa_add_symbol_hook (abfd
, info
, sym
, namep
, flagsp
, secp
, valp
)
1033 struct bfd_link_info
*info ATTRIBUTE_UNUSED
;
1034 const Elf_Internal_Sym
*sym
;
1035 const char **namep ATTRIBUTE_UNUSED
;
1036 flagword
*flagsp ATTRIBUTE_UNUSED
;
1040 int index
= sym
->st_shndx
;
1044 case SHN_PARISC_ANSI_COMMON
:
1045 *secp
= bfd_make_section_old_way (abfd
, ".PARISC.ansi.common");
1046 (*secp
)->flags
|= SEC_IS_COMMON
;
1047 *valp
= sym
->st_size
;
1050 case SHN_PARISC_HUGE_COMMON
:
1051 *secp
= bfd_make_section_old_way (abfd
, ".PARISC.huge.common");
1052 (*secp
)->flags
|= SEC_IS_COMMON
;
1053 *valp
= sym
->st_size
;
1061 elf_hppa_unmark_useless_dynamic_symbols (h
, data
)
1062 struct elf_link_hash_entry
*h
;
1065 struct bfd_link_info
*info
= (struct bfd_link_info
*)data
;
1067 /* If we are not creating a shared library, and this symbol is
1068 referenced by a shared library but is not defined anywhere, then
1069 the generic code will warn that it is undefined.
1071 This behavior is undesirable on HPs since the standard shared
1072 libraries contain references to undefined symbols.
1074 So we twiddle the flags associated with such symbols so that they
1075 will not trigger the warning. ?!? FIXME. This is horribly fragile.
1077 Ultimately we should have better controls over the generic ELF BFD
1079 if (! info
->relocateable
1081 && !info
->no_undefined
)
1082 && h
->root
.type
== bfd_link_hash_undefined
1083 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_DYNAMIC
) != 0
1084 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_REGULAR
) == 0)
1086 h
->elf_link_hash_flags
&= ~ELF_LINK_HASH_REF_DYNAMIC
;
1087 h
->elf_link_hash_flags
|= 0x8000;
1094 elf_hppa_remark_useless_dynamic_symbols (h
, data
)
1095 struct elf_link_hash_entry
*h
;
1098 struct bfd_link_info
*info
= (struct bfd_link_info
*)data
;
1100 /* If we are not creating a shared library, and this symbol is
1101 referenced by a shared library but is not defined anywhere, then
1102 the generic code will warn that it is undefined.
1104 This behavior is undesirable on HPs since the standard shared
1105 libraries contain reerences to undefined symbols.
1107 So we twiddle the flags associated with such symbols so that they
1108 will not trigger the warning. ?!? FIXME. This is horribly fragile.
1110 Ultimately we should have better controls over the generic ELF BFD
1112 if (! info
->relocateable
1114 && !info
->no_undefined
)
1115 && h
->root
.type
== bfd_link_hash_undefined
1116 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_DYNAMIC
) == 0
1117 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_REGULAR
) == 0
1118 && (h
->elf_link_hash_flags
& 0x8000) != 0)
1120 h
->elf_link_hash_flags
|= ELF_LINK_HASH_REF_DYNAMIC
;
1121 h
->elf_link_hash_flags
&= ~0x8000;
1127 /* Record the lowest address for the data and text segments. */
1129 elf_hppa_record_segment_addrs (abfd
, section
, data
)
1130 bfd
*abfd ATTRIBUTE_UNUSED
;
1134 struct elf64_hppa_link_hash_table
*hppa_info
;
1137 hppa_info
= (struct elf64_hppa_link_hash_table
*)data
;
1139 value
= section
->vma
- section
->filepos
;
1141 if (((section
->flags
& (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
))
1142 == (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
))
1143 && value
< hppa_info
->text_segment_base
)
1144 hppa_info
->text_segment_base
= value
;
1145 else if (((section
->flags
& (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
))
1146 == (SEC_ALLOC
| SEC_LOAD
))
1147 && value
< hppa_info
->data_segment_base
)
1148 hppa_info
->data_segment_base
= value
;
1151 /* Called after we have seen all the input files/sections, but before
1152 final symbol resolution and section placement has been determined.
1154 We use this hook to (possibly) provide a value for __gp, then we
1155 fall back to the generic ELF final link routine. */
1158 elf_hppa_final_link (abfd
, info
)
1160 struct bfd_link_info
*info
;
1163 struct elf64_hppa_link_hash_table
*hppa_info
= elf64_hppa_hash_table (info
);
1165 if (! info
->relocateable
)
1167 struct elf_link_hash_entry
*gp
;
1170 /* The linker script defines a value for __gp iff it was referenced
1171 by one of the objects being linked. First try to find the symbol
1172 in the hash table. If that fails, just compute the value __gp
1174 gp
= elf_link_hash_lookup (elf_hash_table (info
), "__gp", false,
1180 /* Adjust the value of __gp as we may want to slide it into the
1181 .plt section so that the stubs can access PLT entries without
1182 using an addil sequence. */
1183 gp
->root
.u
.def
.value
+= hppa_info
->gp_offset
;
1185 gp_val
= (gp
->root
.u
.def
.section
->output_section
->vma
1186 + gp
->root
.u
.def
.section
->output_offset
1187 + gp
->root
.u
.def
.value
);
1193 /* First look for a .plt section. If found, then __gp is the
1194 address of the .plt + gp_offset.
1196 If no .plt is found, then look for .dlt, .opd and .data (in
1197 that order) and set __gp to the base address of whichever section
1200 sec
= hppa_info
->plt_sec
;
1202 gp_val
= (sec
->output_offset
1203 + sec
->output_section
->vma
1204 + hppa_info
->gp_offset
);
1207 sec
= hppa_info
->dlt_sec
;
1209 sec
= hppa_info
->opd_sec
;
1211 sec
= bfd_get_section_by_name (abfd
, ".data");
1215 gp_val
= sec
->output_offset
+ sec
->output_section
->vma
;
1219 /* Install whatever value we found/computed for __gp. */
1220 _bfd_set_gp_value (abfd
, gp_val
);
1223 /* We need to know the base of the text and data segments so that we
1224 can perform SEGREL relocations. We will record the base addresses
1225 when we encounter the first SEGREL relocation. */
1226 hppa_info
->text_segment_base
= (bfd_vma
)-1;
1227 hppa_info
->data_segment_base
= (bfd_vma
)-1;
1229 /* HP's shared libraries have references to symbols that are not
1230 defined anywhere. The generic ELF BFD linker code will complaim
1233 So we detect the losing case and arrange for the flags on the symbol
1234 to indicate that it was never referenced. This keeps the generic
1235 ELF BFD link code happy and appears to not create any secondary
1236 problems. Ultimately we need a way to control the behavior of the
1237 generic ELF BFD link code better. */
1238 elf_link_hash_traverse (elf_hash_table (info
),
1239 elf_hppa_unmark_useless_dynamic_symbols
,
1242 /* Invoke the regular ELF backend linker to do all the work. */
1243 retval
= bfd_elf_bfd_final_link (abfd
, info
);
1245 elf_link_hash_traverse (elf_hash_table (info
),
1246 elf_hppa_remark_useless_dynamic_symbols
,
1252 /* Relocate an HPPA ELF section. */
1255 elf_hppa_relocate_section (output_bfd
, info
, input_bfd
, input_section
,
1256 contents
, relocs
, local_syms
, local_sections
)
1258 struct bfd_link_info
*info
;
1260 asection
*input_section
;
1262 Elf_Internal_Rela
*relocs
;
1263 Elf_Internal_Sym
*local_syms
;
1264 asection
**local_sections
;
1266 Elf_Internal_Shdr
*symtab_hdr
;
1267 Elf_Internal_Rela
*rel
;
1268 Elf_Internal_Rela
*relend
;
1269 struct elf64_hppa_link_hash_table
*hppa_info
= elf64_hppa_hash_table (info
);
1271 symtab_hdr
= &elf_tdata (input_bfd
)->symtab_hdr
;
1274 relend
= relocs
+ input_section
->reloc_count
;
1275 for (; rel
< relend
; rel
++)
1278 reloc_howto_type
*howto
= elf_hppa_howto_table
+ ELF_R_TYPE (rel
->r_info
);
1279 unsigned long r_symndx
;
1280 struct elf_link_hash_entry
*h
;
1281 Elf_Internal_Sym
*sym
;
1284 bfd_reloc_status_type r
;
1285 const char *sym_name
;
1286 const char *dyn_name
;
1287 char *dynh_buf
= NULL
;
1288 size_t dynh_buflen
= 0;
1289 struct elf64_hppa_dyn_hash_entry
*dyn_h
= NULL
;
1291 r_type
= ELF_R_TYPE (rel
->r_info
);
1292 if (r_type
< 0 || r_type
>= (int) R_PARISC_UNIMPLEMENTED
)
1294 bfd_set_error (bfd_error_bad_value
);
1298 r_symndx
= ELF_R_SYM (rel
->r_info
);
1300 if (info
->relocateable
)
1302 /* This is a relocateable link. We don't have to change
1303 anything, unless the reloc is against a section symbol,
1304 in which case we have to adjust according to where the
1305 section symbol winds up in the output section. */
1306 if (r_symndx
< symtab_hdr
->sh_info
)
1308 sym
= local_syms
+ r_symndx
;
1309 if (ELF_ST_TYPE (sym
->st_info
) == STT_SECTION
)
1311 sym_sec
= local_sections
[r_symndx
];
1312 rel
->r_addend
+= sym_sec
->output_offset
;
1319 /* This is a final link. */
1323 if (r_symndx
< symtab_hdr
->sh_info
)
1325 /* This is a local symbol. */
1326 sym
= local_syms
+ r_symndx
;
1327 sym_sec
= local_sections
[r_symndx
];
1328 relocation
= _bfd_elf_rela_local_sym (output_bfd
, sym
, sym_sec
, rel
);
1330 /* If this symbol has an entry in the PA64 dynamic hash
1331 table, then get it. */
1332 dyn_name
= get_dyn_name (input_section
, h
, rel
,
1333 &dynh_buf
, &dynh_buflen
);
1334 dyn_h
= elf64_hppa_dyn_hash_lookup (&hppa_info
->dyn_hash_table
,
1335 dyn_name
, false, false);
1340 /* This is not a local symbol. */
1343 indx
= r_symndx
- symtab_hdr
->sh_info
;
1344 h
= elf_sym_hashes (input_bfd
)[indx
];
1345 while (h
->root
.type
== bfd_link_hash_indirect
1346 || h
->root
.type
== bfd_link_hash_warning
)
1347 h
= (struct elf_link_hash_entry
*) h
->root
.u
.i
.link
;
1348 if (h
->root
.type
== bfd_link_hash_defined
1349 || h
->root
.type
== bfd_link_hash_defweak
)
1351 sym_sec
= h
->root
.u
.def
.section
;
1353 /* If this symbol has an entry in the PA64 dynamic hash
1354 table, then get it. */
1355 dyn_name
= get_dyn_name (input_section
, h
, rel
,
1356 &dynh_buf
, &dynh_buflen
);
1357 dyn_h
= elf64_hppa_dyn_hash_lookup (&hppa_info
->dyn_hash_table
,
1358 dyn_name
, false, false);
1360 /* If we have a relocation against a symbol defined in a
1361 shared library and we have not created an entry in the
1362 PA64 dynamic symbol hash table for it, then we lose. */
1363 if (sym_sec
->output_section
== NULL
&& dyn_h
== NULL
)
1365 (*_bfd_error_handler
)
1366 (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
1367 bfd_archive_filename (input_bfd
), h
->root
.root
.string
,
1368 bfd_get_section_name (input_bfd
, input_section
));
1371 else if (sym_sec
->output_section
)
1372 relocation
= (h
->root
.u
.def
.value
1373 + sym_sec
->output_offset
1374 + sym_sec
->output_section
->vma
);
1375 /* Value will be provided via one of the offsets in the
1376 dyn_h hash table entry. */
1380 /* Allow undefined symbols in shared libraries. */
1381 else if (info
->shared
&& !info
->no_undefined
1382 && ELF_ST_VISIBILITY (h
->other
) == STV_DEFAULT
)
1385 (*info
->callbacks
->undefined_symbol
)
1386 (info
, h
->root
.root
.string
, input_bfd
,
1387 input_section
, rel
->r_offset
, false);
1389 /* If this symbol has an entry in the PA64 dynamic hash
1390 table, then get it. */
1391 dyn_name
= get_dyn_name (input_section
, h
, rel
,
1392 &dynh_buf
, &dynh_buflen
);
1393 dyn_h
= elf64_hppa_dyn_hash_lookup (&hppa_info
->dyn_hash_table
,
1394 dyn_name
, false, false);
1398 (*_bfd_error_handler
)
1399 (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
1400 bfd_archive_filename (input_bfd
), h
->root
.root
.string
,
1401 bfd_get_section_name (input_bfd
, input_section
));
1406 else if (h
->root
.type
== bfd_link_hash_undefweak
)
1410 if (!((*info
->callbacks
->undefined_symbol
)
1411 (info
, h
->root
.root
.string
, input_bfd
,
1412 input_section
, rel
->r_offset
, true)))
1419 sym_name
= h
->root
.root
.string
;
1422 sym_name
= bfd_elf_string_from_elf_section (input_bfd
,
1423 symtab_hdr
->sh_link
,
1425 if (sym_name
== NULL
)
1427 if (*sym_name
== '\0')
1428 sym_name
= bfd_section_name (input_bfd
, sym_sec
);
1431 r
= elf_hppa_final_link_relocate (rel
, input_bfd
, output_bfd
,
1432 input_section
, contents
,
1433 relocation
, info
, sym_sec
,
1436 if (r
!= bfd_reloc_ok
)
1442 case bfd_reloc_overflow
:
1444 if (!((*info
->callbacks
->reloc_overflow
)
1445 (info
, sym_name
, howto
->name
, (bfd_vma
) 0,
1446 input_bfd
, input_section
, rel
->r_offset
)))
1456 /* Compute the value for a relocation (REL) during a final link stage,
1457 then insert the value into the proper location in CONTENTS.
1459 VALUE is a tentative value for the relocation and may be overridden
1460 and modified here based on the specific relocation to be performed.
1462 For example we do conversions for PC-relative branches in this routine
1463 or redirection of calls to external routines to stubs.
1465 The work of actually applying the relocation is left to a helper
1466 routine in an attempt to reduce the complexity and size of this
1469 static bfd_reloc_status_type
1470 elf_hppa_final_link_relocate (rel
, input_bfd
, output_bfd
,
1471 input_section
, contents
, value
,
1472 info
, sym_sec
, h
, dyn_h
)
1473 Elf_Internal_Rela
*rel
;
1476 asection
*input_section
;
1479 struct bfd_link_info
*info
;
1481 struct elf_link_hash_entry
*h ATTRIBUTE_UNUSED
;
1482 struct elf64_hppa_dyn_hash_entry
*dyn_h
;
1485 bfd_vma offset
= rel
->r_offset
;
1486 bfd_signed_vma addend
= rel
->r_addend
;
1487 reloc_howto_type
*howto
= elf_hppa_howto_table
+ ELF_R_TYPE (rel
->r_info
);
1488 unsigned int r_type
= howto
->type
;
1489 bfd_byte
*hit_data
= contents
+ offset
;
1490 struct elf64_hppa_link_hash_table
*hppa_info
= elf64_hppa_hash_table (info
);
1492 insn
= bfd_get_32 (input_bfd
, hit_data
);
1499 /* Basic function call support. I'm not entirely sure if PCREL14F is
1500 actually needed or even handled correctly.
1502 Note for a call to a function defined in another dynamic library
1503 we want to redirect the call to a stub. */
1505 /* Random PC relative relocs. */
1506 case R_PARISC_PCREL21L
:
1507 case R_PARISC_PCREL14R
:
1508 case R_PARISC_PCREL14F
:
1509 case R_PARISC_PCREL14WR
:
1510 case R_PARISC_PCREL14DR
:
1511 case R_PARISC_PCREL16F
:
1512 case R_PARISC_PCREL16WF
:
1513 case R_PARISC_PCREL16DF
:
1515 /* If this is a call to a function defined in another dynamic
1516 library, then redirect the call to the local stub for this
1518 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1519 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1520 + hppa_info
->stub_sec
->output_section
->vma
);
1522 /* Turn VALUE into a proper PC relative address. */
1523 value
-= (offset
+ input_section
->output_offset
1524 + input_section
->output_section
->vma
);
1526 /* Adjust for any field selectors. */
1527 if (r_type
== R_PARISC_PCREL21L
)
1528 value
= hppa_field_adjust (value
, -8 + addend
, e_lsel
);
1529 else if (r_type
== R_PARISC_PCREL14F
1530 || r_type
== R_PARISC_PCREL16F
1531 || r_type
== R_PARISC_PCREL16WF
1532 || r_type
== R_PARISC_PCREL16DF
)
1533 value
= hppa_field_adjust (value
, -8 + addend
, e_fsel
);
1535 value
= hppa_field_adjust (value
, -8 + addend
, e_rsel
);
1537 /* Apply the relocation to the given instruction. */
1538 insn
= elf_hppa_relocate_insn (insn
, (int) value
, r_type
);
1542 case R_PARISC_PCREL12F
:
1543 case R_PARISC_PCREL22F
:
1544 case R_PARISC_PCREL17F
:
1545 case R_PARISC_PCREL22C
:
1546 case R_PARISC_PCREL17C
:
1547 case R_PARISC_PCREL17R
:
1549 /* If this is a call to a function defined in another dynamic
1550 library, then redirect the call to the local stub for this
1552 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1553 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1554 + hppa_info
->stub_sec
->output_section
->vma
);
1556 /* Turn VALUE into a proper PC relative address. */
1557 value
-= (offset
+ input_section
->output_offset
1558 + input_section
->output_section
->vma
);
1560 /* Adjust for any field selectors. */
1561 if (r_type
== R_PARISC_PCREL17R
)
1562 value
= hppa_field_adjust (value
, -8 + addend
, e_rsel
);
1564 value
= hppa_field_adjust (value
, -8 + addend
, e_fsel
);
1566 /* All branches are implicitly shifted by 2 places. */
1569 /* Apply the relocation to the given instruction. */
1570 insn
= elf_hppa_relocate_insn (insn
, (int) value
, r_type
);
1574 /* Indirect references to data through the DLT. */
1575 case R_PARISC_DLTIND14R
:
1576 case R_PARISC_DLTIND14F
:
1577 case R_PARISC_DLTIND14DR
:
1578 case R_PARISC_DLTIND14WR
:
1579 case R_PARISC_DLTIND21L
:
1580 case R_PARISC_LTOFF_FPTR14R
:
1581 case R_PARISC_LTOFF_FPTR14DR
:
1582 case R_PARISC_LTOFF_FPTR14WR
:
1583 case R_PARISC_LTOFF_FPTR21L
:
1584 case R_PARISC_LTOFF_FPTR16F
:
1585 case R_PARISC_LTOFF_FPTR16WF
:
1586 case R_PARISC_LTOFF_FPTR16DF
:
1587 case R_PARISC_LTOFF_TP21L
:
1588 case R_PARISC_LTOFF_TP14R
:
1589 case R_PARISC_LTOFF_TP14F
:
1590 case R_PARISC_LTOFF_TP14WR
:
1591 case R_PARISC_LTOFF_TP14DR
:
1592 case R_PARISC_LTOFF_TP16F
:
1593 case R_PARISC_LTOFF_TP16WF
:
1594 case R_PARISC_LTOFF_TP16DF
:
1595 case R_PARISC_LTOFF16F
:
1596 case R_PARISC_LTOFF16WF
:
1597 case R_PARISC_LTOFF16DF
:
1599 /* If this relocation was against a local symbol, then we still
1600 have not set up the DLT entry (it's not convenient to do so
1601 in the "finalize_dlt" routine because it is difficult to get
1602 to the local symbol's value).
1604 So, if this is a local symbol (h == NULL), then we need to
1605 fill in its DLT entry.
1607 Similarly we may still need to set up an entry in .opd for
1608 a local function which had its address taken. */
1609 if (dyn_h
->h
== NULL
)
1611 bfd_put_64 (hppa_info
->dlt_sec
->owner
,
1613 hppa_info
->dlt_sec
->contents
+ dyn_h
->dlt_offset
);
1615 /* Now handle .opd creation if needed. */
1616 if (r_type
== R_PARISC_LTOFF_FPTR14R
1617 || r_type
== R_PARISC_LTOFF_FPTR14DR
1618 || r_type
== R_PARISC_LTOFF_FPTR14WR
1619 || r_type
== R_PARISC_LTOFF_FPTR21L
1620 || r_type
== R_PARISC_LTOFF_FPTR16F
1621 || r_type
== R_PARISC_LTOFF_FPTR16WF
1622 || r_type
== R_PARISC_LTOFF_FPTR16DF
)
1624 /* The first two words of an .opd entry are zero. */
1625 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
,
1628 /* The next word is the address of the function. */
1629 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1630 (hppa_info
->opd_sec
->contents
1631 + dyn_h
->opd_offset
+ 16));
1633 /* The last word is our local __gp value. */
1634 value
= _bfd_get_gp_value
1635 (hppa_info
->opd_sec
->output_section
->owner
);
1636 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1637 (hppa_info
->opd_sec
->contents
1638 + dyn_h
->opd_offset
+ 24));
1642 /* We want the value of the DLT offset for this symbol, not
1643 the symbol's actual address. Note that __gp may not point
1644 to the start of the DLT, so we have to compute the absolute
1645 address, then subtract out the value of __gp. */
1646 value
= (dyn_h
->dlt_offset
1647 + hppa_info
->dlt_sec
->output_offset
1648 + hppa_info
->dlt_sec
->output_section
->vma
);
1649 value
-= _bfd_get_gp_value (output_bfd
);
1651 /* All DLTIND relocations are basically the same at this point,
1652 except that we need different field selectors for the 21bit
1653 version vs the 14bit versions. */
1654 if (r_type
== R_PARISC_DLTIND21L
1655 || r_type
== R_PARISC_LTOFF_FPTR21L
1656 || r_type
== R_PARISC_LTOFF_TP21L
)
1657 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1658 else if (r_type
== R_PARISC_DLTIND14F
1659 || r_type
== R_PARISC_LTOFF_FPTR16F
1660 || r_type
== R_PARISC_LTOFF_FPTR16WF
1661 || r_type
== R_PARISC_LTOFF_FPTR16DF
1662 || r_type
== R_PARISC_LTOFF16F
1663 || r_type
== R_PARISC_LTOFF16DF
1664 || r_type
== R_PARISC_LTOFF16WF
1665 || r_type
== R_PARISC_LTOFF_TP16F
1666 || r_type
== R_PARISC_LTOFF_TP16WF
1667 || r_type
== R_PARISC_LTOFF_TP16DF
)
1668 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1670 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1672 insn
= elf_hppa_relocate_insn (insn
, (int) value
, r_type
);
1676 case R_PARISC_DLTREL14R
:
1677 case R_PARISC_DLTREL14F
:
1678 case R_PARISC_DLTREL14DR
:
1679 case R_PARISC_DLTREL14WR
:
1680 case R_PARISC_DLTREL21L
:
1681 case R_PARISC_DPREL21L
:
1682 case R_PARISC_DPREL14WR
:
1683 case R_PARISC_DPREL14DR
:
1684 case R_PARISC_DPREL14R
:
1685 case R_PARISC_DPREL14F
:
1686 case R_PARISC_GPREL16F
:
1687 case R_PARISC_GPREL16WF
:
1688 case R_PARISC_GPREL16DF
:
1690 /* Subtract out the global pointer value to make value a DLT
1691 relative address. */
1692 value
-= _bfd_get_gp_value (output_bfd
);
1694 /* All DLTREL relocations are basically the same at this point,
1695 except that we need different field selectors for the 21bit
1696 version vs the 14bit versions. */
1697 if (r_type
== R_PARISC_DLTREL21L
1698 || r_type
== R_PARISC_DPREL21L
)
1699 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1700 else if (r_type
== R_PARISC_DLTREL14F
1701 || r_type
== R_PARISC_DPREL14F
1702 || r_type
== R_PARISC_GPREL16F
1703 || r_type
== R_PARISC_GPREL16WF
1704 || r_type
== R_PARISC_GPREL16DF
)
1705 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1707 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1709 insn
= elf_hppa_relocate_insn (insn
, (int) value
, r_type
);
1713 case R_PARISC_DIR21L
:
1714 case R_PARISC_DIR17R
:
1715 case R_PARISC_DIR17F
:
1716 case R_PARISC_DIR14R
:
1717 case R_PARISC_DIR14F
:
1718 case R_PARISC_DIR14WR
:
1719 case R_PARISC_DIR14DR
:
1720 case R_PARISC_DIR16F
:
1721 case R_PARISC_DIR16WF
:
1722 case R_PARISC_DIR16DF
:
1724 /* All DIR relocations are basically the same at this point,
1725 except that branch offsets need to be divided by four, and
1726 we need different field selectors. Note that we don't
1727 redirect absolute calls to local stubs. */
1729 if (r_type
== R_PARISC_DIR21L
)
1730 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1731 else if (r_type
== R_PARISC_DIR17F
1732 || r_type
== R_PARISC_DIR16F
1733 || r_type
== R_PARISC_DIR16WF
1734 || r_type
== R_PARISC_DIR16DF
1735 || r_type
== R_PARISC_DIR14F
)
1736 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1738 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1740 if (r_type
== R_PARISC_DIR17R
|| r_type
== R_PARISC_DIR17F
)
1742 /* All branches are implicitly shifted by 2 places. */
1746 insn
= elf_hppa_relocate_insn (insn
, (int) value
, r_type
);
1750 case R_PARISC_PLTOFF21L
:
1751 case R_PARISC_PLTOFF14R
:
1752 case R_PARISC_PLTOFF14F
:
1753 case R_PARISC_PLTOFF14WR
:
1754 case R_PARISC_PLTOFF14DR
:
1755 case R_PARISC_PLTOFF16F
:
1756 case R_PARISC_PLTOFF16WF
:
1757 case R_PARISC_PLTOFF16DF
:
1759 /* We want the value of the PLT offset for this symbol, not
1760 the symbol's actual address. Note that __gp may not point
1761 to the start of the DLT, so we have to compute the absolute
1762 address, then subtract out the value of __gp. */
1763 value
= (dyn_h
->plt_offset
1764 + hppa_info
->plt_sec
->output_offset
1765 + hppa_info
->plt_sec
->output_section
->vma
);
1766 value
-= _bfd_get_gp_value (output_bfd
);
1768 /* All PLTOFF relocations are basically the same at this point,
1769 except that we need different field selectors for the 21bit
1770 version vs the 14bit versions. */
1771 if (r_type
== R_PARISC_PLTOFF21L
)
1772 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1773 else if (r_type
== R_PARISC_PLTOFF14F
1774 || r_type
== R_PARISC_PLTOFF16F
1775 || r_type
== R_PARISC_PLTOFF16WF
1776 || r_type
== R_PARISC_PLTOFF16DF
)
1777 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1779 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1781 insn
= elf_hppa_relocate_insn (insn
, (int) value
, r_type
);
1785 case R_PARISC_LTOFF_FPTR32
:
1787 /* We may still need to create the FPTR itself if it was for
1789 if (dyn_h
->h
== NULL
)
1791 /* The first two words of an .opd entry are zero. */
1792 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
, 0, 16);
1794 /* The next word is the address of the function. */
1795 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1796 (hppa_info
->opd_sec
->contents
1797 + dyn_h
->opd_offset
+ 16));
1799 /* The last word is our local __gp value. */
1800 value
= _bfd_get_gp_value
1801 (hppa_info
->opd_sec
->output_section
->owner
);
1802 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1803 hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
+ 24);
1806 /* We want the value of the DLT offset for this symbol, not
1807 the symbol's actual address. Note that __gp may not point
1808 to the start of the DLT, so we have to compute the absolute
1809 address, then subtract out the value of __gp. */
1810 value
= (dyn_h
->dlt_offset
1811 + hppa_info
->dlt_sec
->output_offset
1812 + hppa_info
->dlt_sec
->output_section
->vma
);
1813 value
-= _bfd_get_gp_value (output_bfd
);
1814 bfd_put_32 (input_bfd
, value
, hit_data
);
1815 return bfd_reloc_ok
;
1818 case R_PARISC_LTOFF_FPTR64
:
1819 case R_PARISC_LTOFF_TP64
:
1821 /* We may still need to create the FPTR itself if it was for
1823 if (dyn_h
->h
== NULL
&& r_type
== R_PARISC_LTOFF_FPTR64
)
1825 /* The first two words of an .opd entry are zero. */
1826 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
, 0, 16);
1828 /* The next word is the address of the function. */
1829 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1830 (hppa_info
->opd_sec
->contents
1831 + dyn_h
->opd_offset
+ 16));
1833 /* The last word is our local __gp value. */
1834 value
= _bfd_get_gp_value
1835 (hppa_info
->opd_sec
->output_section
->owner
);
1836 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1837 hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
+ 24);
1840 /* We want the value of the DLT offset for this symbol, not
1841 the symbol's actual address. Note that __gp may not point
1842 to the start of the DLT, so we have to compute the absolute
1843 address, then subtract out the value of __gp. */
1844 value
= (dyn_h
->dlt_offset
1845 + hppa_info
->dlt_sec
->output_offset
1846 + hppa_info
->dlt_sec
->output_section
->vma
);
1847 value
-= _bfd_get_gp_value (output_bfd
);
1848 bfd_put_64 (input_bfd
, value
, hit_data
);
1849 return bfd_reloc_ok
;
1852 case R_PARISC_DIR32
:
1853 bfd_put_32 (input_bfd
, value
+ addend
, hit_data
);
1854 return bfd_reloc_ok
;
1856 case R_PARISC_DIR64
:
1857 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1858 return bfd_reloc_ok
;
1860 case R_PARISC_GPREL64
:
1861 /* Subtract out the global pointer value to make value a DLT
1862 relative address. */
1863 value
-= _bfd_get_gp_value (output_bfd
);
1865 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1866 return bfd_reloc_ok
;
1868 case R_PARISC_LTOFF64
:
1869 /* We want the value of the DLT offset for this symbol, not
1870 the symbol's actual address. Note that __gp may not point
1871 to the start of the DLT, so we have to compute the absolute
1872 address, then subtract out the value of __gp. */
1873 value
= (dyn_h
->dlt_offset
1874 + hppa_info
->dlt_sec
->output_offset
1875 + hppa_info
->dlt_sec
->output_section
->vma
);
1876 value
-= _bfd_get_gp_value (output_bfd
);
1878 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1879 return bfd_reloc_ok
;
1881 case R_PARISC_PCREL32
:
1883 /* If this is a call to a function defined in another dynamic
1884 library, then redirect the call to the local stub for this
1886 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1887 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1888 + hppa_info
->stub_sec
->output_section
->vma
);
1890 /* Turn VALUE into a proper PC relative address. */
1891 value
-= (offset
+ input_section
->output_offset
1892 + input_section
->output_section
->vma
);
1896 bfd_put_32 (input_bfd
, value
, hit_data
);
1897 return bfd_reloc_ok
;
1900 case R_PARISC_PCREL64
:
1902 /* If this is a call to a function defined in another dynamic
1903 library, then redirect the call to the local stub for this
1905 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1906 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1907 + hppa_info
->stub_sec
->output_section
->vma
);
1909 /* Turn VALUE into a proper PC relative address. */
1910 value
-= (offset
+ input_section
->output_offset
1911 + input_section
->output_section
->vma
);
1915 bfd_put_64 (input_bfd
, value
, hit_data
);
1916 return bfd_reloc_ok
;
1919 case R_PARISC_FPTR64
:
1921 /* We may still need to create the FPTR itself if it was for
1923 if (dyn_h
->h
== NULL
)
1925 /* The first two words of an .opd entry are zero. */
1926 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
, 0, 16);
1928 /* The next word is the address of the function. */
1929 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1930 (hppa_info
->opd_sec
->contents
1931 + dyn_h
->opd_offset
+ 16));
1933 /* The last word is our local __gp value. */
1934 value
= _bfd_get_gp_value
1935 (hppa_info
->opd_sec
->output_section
->owner
);
1936 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1937 hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
+ 24);
1940 /* We want the value of the OPD offset for this symbol, not
1941 the symbol's actual address. */
1942 value
= (dyn_h
->opd_offset
1943 + hppa_info
->opd_sec
->output_offset
1944 + hppa_info
->opd_sec
->output_section
->vma
);
1946 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1947 return bfd_reloc_ok
;
1950 case R_PARISC_SECREL32
:
1951 bfd_put_32 (input_bfd
,
1952 value
+ addend
- sym_sec
->output_section
->vma
,
1954 return bfd_reloc_ok
;
1956 case R_PARISC_SEGREL32
:
1957 case R_PARISC_SEGREL64
:
1959 /* If this is the first SEGREL relocation, then initialize
1960 the segment base values. */
1961 if (hppa_info
->text_segment_base
== (bfd_vma
) -1)
1962 bfd_map_over_sections (output_bfd
, elf_hppa_record_segment_addrs
,
1965 /* VALUE holds the absolute address. We want to include the
1966 addend, then turn it into a segment relative address.
1968 The segment is derived from SYM_SEC. We assume that there are
1969 only two segments of note in the resulting executable/shlib.
1970 A readonly segment (.text) and a readwrite segment (.data). */
1973 if (sym_sec
->flags
& SEC_CODE
)
1974 value
-= hppa_info
->text_segment_base
;
1976 value
-= hppa_info
->data_segment_base
;
1978 if (r_type
== R_PARISC_SEGREL32
)
1979 bfd_put_32 (input_bfd
, value
, hit_data
);
1981 bfd_put_64 (input_bfd
, value
, hit_data
);
1982 return bfd_reloc_ok
;
1985 /* Something we don't know how to handle. */
1987 return bfd_reloc_notsupported
;
1990 /* Update the instruction word. */
1991 bfd_put_32 (input_bfd
, (bfd_vma
) insn
, hit_data
);
1992 return bfd_reloc_ok
;
1995 /* Relocate the given INSN. VALUE should be the actual value we want
1996 to insert into the instruction, ie by this point we should not be
1997 concerned with computing an offset relative to the DLT, PC, etc.
1998 Instead this routine is meant to handle the bit manipulations needed
1999 to insert the relocation into the given instruction. */
2002 elf_hppa_relocate_insn (insn
, sym_value
, r_type
)
2005 unsigned int r_type
;
2009 /* This is any 22 bit branch. In PA2.0 syntax it corresponds to
2010 the "B" instruction. */
2011 case R_PARISC_PCREL22F
:
2012 case R_PARISC_PCREL22C
:
2013 return (insn
& ~0x3ff1ffd) | re_assemble_22 (sym_value
);
2015 /* This is any 12 bit branch. */
2016 case R_PARISC_PCREL12F
:
2017 return (insn
& ~0x1ffd) | re_assemble_12 (sym_value
);
2019 /* This is any 17 bit branch. In PA2.0 syntax it also corresponds
2020 to the "B" instruction as well as BE. */
2021 case R_PARISC_PCREL17F
:
2022 case R_PARISC_DIR17F
:
2023 case R_PARISC_DIR17R
:
2024 case R_PARISC_PCREL17C
:
2025 case R_PARISC_PCREL17R
:
2026 return (insn
& ~0x1f1ffd) | re_assemble_17 (sym_value
);
2028 /* ADDIL or LDIL instructions. */
2029 case R_PARISC_DLTREL21L
:
2030 case R_PARISC_DLTIND21L
:
2031 case R_PARISC_LTOFF_FPTR21L
:
2032 case R_PARISC_PCREL21L
:
2033 case R_PARISC_LTOFF_TP21L
:
2034 case R_PARISC_DPREL21L
:
2035 case R_PARISC_PLTOFF21L
:
2036 case R_PARISC_DIR21L
:
2037 return (insn
& ~0x1fffff) | re_assemble_21 (sym_value
);
2039 /* LDO and integer loads/stores with 14 bit displacements. */
2040 case R_PARISC_DLTREL14R
:
2041 case R_PARISC_DLTREL14F
:
2042 case R_PARISC_DLTIND14R
:
2043 case R_PARISC_DLTIND14F
:
2044 case R_PARISC_LTOFF_FPTR14R
:
2045 case R_PARISC_LTOFF_FPTR16F
:
2046 case R_PARISC_PCREL14R
:
2047 case R_PARISC_PCREL14F
:
2048 case R_PARISC_PCREL16F
:
2049 case R_PARISC_LTOFF_TP14R
:
2050 case R_PARISC_LTOFF_TP14F
:
2051 case R_PARISC_LTOFF_TP16F
:
2052 case R_PARISC_DPREL14R
:
2053 case R_PARISC_DPREL14F
:
2054 case R_PARISC_GPREL16F
:
2055 case R_PARISC_PLTOFF14R
:
2056 case R_PARISC_PLTOFF14F
:
2057 case R_PARISC_PLTOFF16F
:
2058 case R_PARISC_DIR14R
:
2059 case R_PARISC_DIR14F
:
2060 case R_PARISC_DIR16F
:
2061 case R_PARISC_LTOFF16F
:
2062 return (insn
& ~0x3fff) | low_sign_unext (sym_value
, 14);
2064 /* Doubleword loads and stores with a 14 bit displacement. */
2065 case R_PARISC_DLTREL14DR
:
2066 case R_PARISC_DLTIND14DR
:
2067 case R_PARISC_LTOFF_FPTR14DR
:
2068 case R_PARISC_LTOFF_FPTR16DF
:
2069 case R_PARISC_PCREL14DR
:
2070 case R_PARISC_PCREL16DF
:
2071 case R_PARISC_LTOFF_TP14DR
:
2072 case R_PARISC_LTOFF_TP16DF
:
2073 case R_PARISC_DPREL14DR
:
2074 case R_PARISC_GPREL16DF
:
2075 case R_PARISC_PLTOFF14DR
:
2076 case R_PARISC_PLTOFF16DF
:
2077 case R_PARISC_DIR14DR
:
2078 case R_PARISC_DIR16DF
:
2079 case R_PARISC_LTOFF16DF
:
2080 return (insn
& ~0x3ff1) | (((sym_value
& 0x2000) >> 13)
2081 | ((sym_value
& 0x1ff8) << 1));
2083 /* Floating point single word load/store instructions. */
2084 case R_PARISC_DLTREL14WR
:
2085 case R_PARISC_DLTIND14WR
:
2086 case R_PARISC_LTOFF_FPTR14WR
:
2087 case R_PARISC_LTOFF_FPTR16WF
:
2088 case R_PARISC_PCREL14WR
:
2089 case R_PARISC_PCREL16WF
:
2090 case R_PARISC_LTOFF_TP14WR
:
2091 case R_PARISC_LTOFF_TP16WF
:
2092 case R_PARISC_DPREL14WR
:
2093 case R_PARISC_GPREL16WF
:
2094 case R_PARISC_PLTOFF14WR
:
2095 case R_PARISC_PLTOFF16WF
:
2096 case R_PARISC_DIR16WF
:
2097 case R_PARISC_DIR14WR
:
2098 case R_PARISC_LTOFF16WF
:
2099 return (insn
& ~0x3ff9) | (((sym_value
& 0x2000) >> 13)
2100 | ((sym_value
& 0x1ffc) << 1));