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, 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
;
691 final_type
= R_PARISC_DIR21L
;
694 final_type
= R_PARISC_DLTIND21L
;
697 final_type
= R_PARISC_LTOFF_FPTR21L
;
700 final_type
= R_PARISC_PLABEL21L
;
711 final_type
= R_PARISC_DIR32
;
712 /* When in 64bit mode, a 32bit relocation is supposed to
713 be a section relative relocation. Dwarf2 (for example)
714 uses 32bit section relative relocations. */
715 if (bfd_get_arch_info (abfd
)->bits_per_address
!= 32)
716 final_type
= R_PARISC_SECREL32
;
719 final_type
= R_PARISC_PLABEL32
;
730 final_type
= R_PARISC_DIR64
;
733 final_type
= R_PARISC_FPTR64
;
754 final_type
= base_type
+ OFFSET_14R_FROM_21L
;
757 final_type
= base_type
+ OFFSET_14F_FROM_21L
;
769 final_type
= base_type
;
782 case R_HPPA_PCREL_CALL
:
790 final_type
= R_PARISC_PCREL14R
;
793 final_type
= R_PARISC_PCREL14F
;
805 final_type
= R_PARISC_PCREL17R
;
808 final_type
= R_PARISC_PCREL17F
;
819 final_type
= R_PARISC_PCREL22F
;
831 final_type
= R_PARISC_PCREL21L
;
843 case R_PARISC_SEGREL32
:
844 case R_PARISC_SEGBASE
:
845 /* The defaults are fine for these cases. */
855 /* Translate from an elf into field into a howto relocation pointer. */
858 elf_hppa_info_to_howto (abfd
, bfd_reloc
, elf_reloc
)
859 bfd
*abfd ATTRIBUTE_UNUSED
;
861 Elf_Internal_Rela
*elf_reloc
;
863 BFD_ASSERT (ELF_R_TYPE(elf_reloc
->r_info
)
864 < (unsigned int) R_PARISC_UNIMPLEMENTED
);
865 bfd_reloc
->howto
= &elf_hppa_howto_table
[ELF_R_TYPE (elf_reloc
->r_info
)];
868 /* Translate from an elf into field into a howto relocation pointer. */
871 elf_hppa_info_to_howto_rel (abfd
, bfd_reloc
, elf_reloc
)
872 bfd
*abfd ATTRIBUTE_UNUSED
;
874 Elf_Internal_Rel
*elf_reloc
;
876 BFD_ASSERT (ELF_R_TYPE(elf_reloc
->r_info
)
877 < (unsigned int) R_PARISC_UNIMPLEMENTED
);
878 bfd_reloc
->howto
= &elf_hppa_howto_table
[ELF_R_TYPE (elf_reloc
->r_info
)];
881 /* Return the address of the howto table entry to perform the CODE
882 relocation for an ARCH machine. */
884 static reloc_howto_type
*
885 elf_hppa_reloc_type_lookup (abfd
, code
)
886 bfd
*abfd ATTRIBUTE_UNUSED
;
887 bfd_reloc_code_real_type code
;
889 if ((int) code
< (int) R_PARISC_UNIMPLEMENTED
)
891 BFD_ASSERT ((int) elf_hppa_howto_table
[(int) code
].type
== (int) code
);
892 return &elf_hppa_howto_table
[(int) code
];
897 /* Return true if SYM represents a local label symbol. */
900 elf_hppa_is_local_label_name (abfd
, name
)
901 bfd
*abfd ATTRIBUTE_UNUSED
;
904 return (name
[0] == 'L' && name
[1] == '$');
907 /* Set the correct type for an ELF section. We do this by the
908 section name, which is a hack, but ought to work. */
911 elf_hppa_fake_sections (abfd
, hdr
, sec
)
913 elf_hppa_internal_shdr
*hdr
;
916 register const char *name
;
918 name
= bfd_get_section_name (abfd
, sec
);
920 if (strcmp (name
, ".PARISC.unwind") == 0)
925 hdr
->sh_type
= SHT_LOPROC
+ 1;
929 /* ?!? How are unwinds supposed to work for symbols in arbitrary
930 sections? Or what if we have multiple .text sections in a single
931 .o file? HP really messed up on this one.
933 Ugh. We can not use elf_section_data (sec)->this_idx at this
934 point because it is not initialized yet.
936 So we (gasp) recompute it here. Hopefully nobody ever changes the
937 way sections are numbered in elf.c! */
938 for (sec
= abfd
->sections
, indx
= 1; sec
; sec
= sec
->next
, indx
++)
940 if (sec
->name
&& strcmp (sec
->name
, ".text") == 0)
947 /* I have no idea if this is really necessary or what it means. */
955 elf_hppa_final_write_processing (abfd
, linker
)
959 int mach
= bfd_get_mach (abfd
);
961 elf_elfheader (abfd
)->e_flags
&= ~(EF_PARISC_ARCH
| EF_PARISC_TRAPNIL
962 | EF_PARISC_EXT
| EF_PARISC_LSB
963 | EF_PARISC_WIDE
| EF_PARISC_NO_KABP
964 | EF_PARISC_LAZYSWAP
);
967 elf_elfheader (abfd
)->e_flags
|= EFA_PARISC_1_0
;
969 elf_elfheader (abfd
)->e_flags
|= EFA_PARISC_1_1
;
971 elf_elfheader (abfd
)->e_flags
|= EFA_PARISC_2_0
;
973 elf_elfheader (abfd
)->e_flags
|= (EF_PARISC_WIDE
975 /* The GNU tools have trapped without
976 option since 1993, so need to take
977 a step backwards with the ELF
979 | EF_PARISC_TRAPNIL
);
982 /* Hook called by the linker routine which adds symbols from an object
983 file. HP's libraries define symbols with HP specific section
984 indices, which we have to handle. */
987 elf_hppa_add_symbol_hook (abfd
, info
, sym
, namep
, flagsp
, secp
, valp
)
989 struct bfd_link_info
*info ATTRIBUTE_UNUSED
;
990 const Elf_Internal_Sym
*sym
;
991 const char **namep ATTRIBUTE_UNUSED
;
992 flagword
*flagsp ATTRIBUTE_UNUSED
;
996 int index
= sym
->st_shndx
;
1000 case SHN_PARISC_ANSI_COMMON
:
1001 *secp
= bfd_make_section_old_way (abfd
, ".PARISC.ansi.common");
1002 (*secp
)->flags
|= SEC_IS_COMMON
;
1003 *valp
= sym
->st_size
;
1006 case SHN_PARISC_HUGE_COMMON
:
1007 *secp
= bfd_make_section_old_way (abfd
, ".PARISC.huge.common");
1008 (*secp
)->flags
|= SEC_IS_COMMON
;
1009 *valp
= sym
->st_size
;
1017 elf_hppa_unmark_useless_dynamic_symbols (h
, data
)
1018 struct elf_link_hash_entry
*h
;
1021 struct bfd_link_info
*info
= (struct bfd_link_info
*)data
;
1023 /* If we are not creating a shared library, and this symbol is
1024 referenced by a shared library but is not defined anywhere, then
1025 the generic code will warn that it is undefined.
1027 This behavior is undesirable on HPs since the standard shared
1028 libraries contain references to undefined symbols.
1030 So we twiddle the flags associated with such symbols so that they
1031 will not trigger the warning. ?!? FIXME. This is horribly fragile.
1033 Ultimately we should have better controls over the generic ELF BFD
1035 if (! info
->relocateable
1037 && !info
->no_undefined
)
1038 && h
->root
.type
== bfd_link_hash_undefined
1039 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_DYNAMIC
) != 0
1040 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_REGULAR
) == 0)
1042 h
->elf_link_hash_flags
&= ~ELF_LINK_HASH_REF_DYNAMIC
;
1043 h
->elf_link_hash_flags
|= 0x8000;
1051 elf_hppa_remark_useless_dynamic_symbols (h
, data
)
1052 struct elf_link_hash_entry
*h
;
1055 struct bfd_link_info
*info
= (struct bfd_link_info
*)data
;
1057 /* If we are not creating a shared library, and this symbol is
1058 referenced by a shared library but is not defined anywhere, then
1059 the generic code will warn that it is undefined.
1061 This behavior is undesirable on HPs since the standard shared
1062 libraries contain reerences to undefined symbols.
1064 So we twiddle the flags associated with such symbols so that they
1065 will not trigger the warning. ?!? FIXME. This is horribly fragile.
1067 Ultimately we should have better controls over the generic ELF BFD
1069 if (! info
->relocateable
1071 && !info
->no_undefined
)
1072 && h
->root
.type
== bfd_link_hash_undefined
1073 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_DYNAMIC
) == 0
1074 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_REF_REGULAR
) == 0
1075 && (h
->elf_link_hash_flags
& 0x8000) != 0)
1077 h
->elf_link_hash_flags
|= ELF_LINK_HASH_REF_DYNAMIC
;
1078 h
->elf_link_hash_flags
&= ~0x8000;
1084 /* Record the lowest address for the data and text segments. */
1086 elf_hppa_record_segment_addrs (abfd
, section
, data
)
1087 bfd
*abfd ATTRIBUTE_UNUSED
;
1091 struct elf64_hppa_link_hash_table
*hppa_info
;
1094 hppa_info
= (struct elf64_hppa_link_hash_table
*)data
;
1096 value
= section
->vma
- section
->filepos
;
1098 if ((section
->flags
& (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
)
1099 == (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
))
1100 && value
< hppa_info
->text_segment_base
)
1101 hppa_info
->text_segment_base
= value
;
1102 else if ((section
->flags
& (SEC_ALLOC
| SEC_LOAD
| SEC_READONLY
)
1103 == (SEC_ALLOC
| SEC_LOAD
))
1104 && value
< hppa_info
->data_segment_base
)
1105 hppa_info
->data_segment_base
= value
;
1108 /* Called after we have seen all the input files/sections, but before
1109 final symbol resolution and section placement has been determined.
1111 We use this hook to (possibly) provide a value for __gp, then we
1112 fall back to the generic ELF final link routine. */
1115 elf_hppa_final_link (abfd
, info
)
1117 struct bfd_link_info
*info
;
1121 if (! info
->relocateable
)
1123 struct elf_link_hash_entry
*gp
;
1125 struct elf64_hppa_link_hash_table
*hppa_info
;
1127 hppa_info
= elf64_hppa_hash_table (info
);
1129 /* The linker script defines a value for __gp iff it was referenced
1130 by one of the objects being linked. First try to find the symbol
1131 in the hash table. If that fails, just compute the value __gp
1133 gp
= elf_link_hash_lookup (elf_hash_table (info
), "__gp", false,
1139 /* Adjust the value of __gp as we may want to slide it into the
1140 .plt section so that the stubs can access PLT entries without
1141 using an addil sequence. */
1142 gp
->root
.u
.def
.value
+= elf64_hppa_hash_table (info
)->gp_offset
;
1144 gp_val
= (gp
->root
.u
.def
.section
->output_section
->vma
1145 + gp
->root
.u
.def
.section
->output_offset
1146 + gp
->root
.u
.def
.value
);
1153 /* First look for a .plt section. If found, then __gp is the
1154 address of the .plt + gp_offset.
1156 If no .plt is found, then look for .dlt, .opd and .data (in
1157 that order) and set __gp to the base address of whichever section
1160 sec
= hppa_info
->plt_sec
;
1162 gp_val
= (sec
->output_offset
1163 + sec
->output_section
->vma
1164 + hppa_info
->gp_offset
);
1167 sec
= hppa_info
->dlt_sec
;
1169 sec
= hppa_info
->opd_sec
;
1171 sec
= bfd_get_section_by_name (abfd
, ".data");
1175 gp_val
= sec
->output_offset
+ sec
->output_section
->vma
;
1179 /* Install whatever value we found/computed for __gp. */
1180 _bfd_set_gp_value (abfd
, gp_val
);
1183 /* We need to know the base of the text and data segments so that we
1184 can perform SEGREL relocations. We will recore the base addresses
1185 when we encounter the first SEGREL relocation. */
1186 elf64_hppa_hash_table (info
)->text_segment_base
= (bfd_vma
)-1;
1187 elf64_hppa_hash_table (info
)->data_segment_base
= (bfd_vma
)-1;
1189 /* HP's shared libraries have references to symbols that are not
1190 defined anywhere. The generic ELF BFD linker code will complaim
1193 So we detect the losing case and arrange for the flags on the symbol
1194 to indicate that it was never referenced. This keeps the generic
1195 ELF BFD link code happy and appears to not create any secondary
1196 problems. Ultimately we need a way to control the behavior of the
1197 generic ELF BFD link code better. */
1198 elf_link_hash_traverse (elf_hash_table (info
),
1199 elf_hppa_unmark_useless_dynamic_symbols
,
1202 /* Invoke the regular ELF backend linker to do all the work. */
1203 retval
= bfd_elf_bfd_final_link (abfd
, info
);
1205 elf_link_hash_traverse (elf_hash_table (info
),
1206 elf_hppa_remark_useless_dynamic_symbols
,
1212 /* Relocate an HPPA ELF section. */
1215 elf_hppa_relocate_section (output_bfd
, info
, input_bfd
, input_section
,
1216 contents
, relocs
, local_syms
, local_sections
)
1218 struct bfd_link_info
*info
;
1220 asection
*input_section
;
1222 Elf_Internal_Rela
*relocs
;
1223 Elf_Internal_Sym
*local_syms
;
1224 asection
**local_sections
;
1226 Elf_Internal_Shdr
*symtab_hdr
;
1227 Elf_Internal_Rela
*rel
;
1228 Elf_Internal_Rela
*relend
;
1229 struct elf64_hppa_link_hash_table
*hppa_info
= elf64_hppa_hash_table (info
);
1231 symtab_hdr
= &elf_tdata (input_bfd
)->symtab_hdr
;
1234 relend
= relocs
+ input_section
->reloc_count
;
1235 for (; rel
< relend
; rel
++)
1238 reloc_howto_type
*howto
= elf_hppa_howto_table
+ ELF_R_TYPE (rel
->r_info
);
1239 unsigned long r_symndx
;
1240 struct elf_link_hash_entry
*h
;
1241 Elf_Internal_Sym
*sym
;
1244 bfd_reloc_status_type r
;
1245 const char *sym_name
;
1247 char *dynh_buf
= NULL
;
1248 size_t dynh_buflen
= 0;
1249 struct elf64_hppa_dyn_hash_entry
*dyn_h
= NULL
;
1251 r_type
= ELF_R_TYPE (rel
->r_info
);
1252 if (r_type
< 0 || r_type
>= (int) R_PARISC_UNIMPLEMENTED
)
1254 bfd_set_error (bfd_error_bad_value
);
1258 r_symndx
= ELF_R_SYM (rel
->r_info
);
1260 if (info
->relocateable
)
1262 /* This is a relocateable link. We don't have to change
1263 anything, unless the reloc is against a section symbol,
1264 in which case we have to adjust according to where the
1265 section symbol winds up in the output section. */
1266 if (r_symndx
< symtab_hdr
->sh_info
)
1268 sym
= local_syms
+ r_symndx
;
1269 if (ELF_ST_TYPE (sym
->st_info
) == STT_SECTION
)
1271 sym_sec
= local_sections
[r_symndx
];
1272 rel
->r_addend
+= sym_sec
->output_offset
;
1279 /* This is a final link. */
1283 if (r_symndx
< symtab_hdr
->sh_info
)
1285 /* This is a local symbol. */
1286 sym
= local_syms
+ r_symndx
;
1287 sym_sec
= local_sections
[r_symndx
];
1288 relocation
= ((ELF_ST_TYPE (sym
->st_info
) == STT_SECTION
1289 ? 0 : sym
->st_value
)
1290 + sym_sec
->output_offset
1291 + sym_sec
->output_section
->vma
);
1293 /* If this symbol has an entry in the PA64 dynamic hash
1294 table, then get it. */
1295 dyn_name
= get_dyn_name (input_bfd
, h
, rel
,
1296 &dynh_buf
, &dynh_buflen
);
1297 dyn_h
= elf64_hppa_dyn_hash_lookup (&hppa_info
->dyn_hash_table
,
1298 dyn_name
, false, false);
1303 /* This is not a local symbol. */
1306 indx
= r_symndx
- symtab_hdr
->sh_info
;
1307 h
= elf_sym_hashes (input_bfd
)[indx
];
1308 while (h
->root
.type
== bfd_link_hash_indirect
1309 || h
->root
.type
== bfd_link_hash_warning
)
1310 h
= (struct elf_link_hash_entry
*) h
->root
.u
.i
.link
;
1311 if (h
->root
.type
== bfd_link_hash_defined
1312 || h
->root
.type
== bfd_link_hash_defweak
)
1314 sym_sec
= h
->root
.u
.def
.section
;
1316 /* If this symbol has an entry in the PA64 dynamic hash
1317 table, then get it. */
1318 dyn_name
= get_dyn_name (input_bfd
, h
, rel
,
1319 &dynh_buf
, &dynh_buflen
);
1320 dyn_h
= elf64_hppa_dyn_hash_lookup (&hppa_info
->dyn_hash_table
,
1321 dyn_name
, false, false);
1323 /* If we have a relocation against a symbol defined in a
1324 shared library and we have not created an entry in the
1325 PA64 dynamic symbol hash table for it, then we lose. */
1326 if (sym_sec
->output_section
== NULL
&& dyn_h
== NULL
)
1328 (*_bfd_error_handler
)
1329 (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
1330 bfd_get_filename (input_bfd
), h
->root
.root
.string
,
1331 bfd_get_section_name (input_bfd
, input_section
));
1334 else if (sym_sec
->output_section
)
1335 relocation
= (h
->root
.u
.def
.value
1336 + sym_sec
->output_offset
1337 + sym_sec
->output_section
->vma
);
1338 /* Value will be provided via one of the offsets in the
1339 dyn_h hash table entry. */
1343 /* Allow undefined symbols in shared libraries. */
1344 else if (info
->shared
&& !info
->no_undefined
)
1347 (*info
->callbacks
->undefined_symbol
)
1348 (info
, h
->root
.root
.string
, input_bfd
,
1349 input_section
, rel
->r_offset
, false);
1351 /* If this symbol has an entry in the PA64 dynamic hash
1352 table, then get it. */
1353 dyn_name
= get_dyn_name (input_bfd
, h
, rel
,
1354 &dynh_buf
, &dynh_buflen
);
1355 dyn_h
= elf64_hppa_dyn_hash_lookup (&hppa_info
->dyn_hash_table
,
1356 dyn_name
, false, false);
1360 (*_bfd_error_handler
)
1361 (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
1362 bfd_get_filename (input_bfd
), h
->root
.root
.string
,
1363 bfd_get_section_name (input_bfd
, input_section
));
1368 else if (h
->root
.type
== bfd_link_hash_undefweak
)
1372 if (!((*info
->callbacks
->undefined_symbol
)
1373 (info
, h
->root
.root
.string
, input_bfd
,
1374 input_section
, rel
->r_offset
, true)))
1381 sym_name
= h
->root
.root
.string
;
1384 sym_name
= bfd_elf_string_from_elf_section (input_bfd
,
1385 symtab_hdr
->sh_link
,
1387 if (sym_name
== NULL
)
1389 if (*sym_name
== '\0')
1390 sym_name
= bfd_section_name (input_bfd
, sym_sec
);
1393 r
= elf_hppa_final_link_relocate (rel
, input_bfd
, output_bfd
,
1394 input_section
, contents
,
1395 relocation
, info
, sym_sec
,
1398 if (r
!= bfd_reloc_ok
)
1404 case bfd_reloc_overflow
:
1406 if (!((*info
->callbacks
->reloc_overflow
)
1407 (info
, sym_name
, howto
->name
, (bfd_vma
) 0,
1408 input_bfd
, input_section
, rel
->r_offset
)))
1419 /* Compute the value for a relocation (REL) during a final link stage,
1420 then insert the value into the proper location in CONTENTS.
1422 VALUE is a tentative value for the relocation and may be overridden
1423 and modified here based on the specific relocation to be performed.
1425 For example we do conversions for PC-relative branches in this routine
1426 or redirection of calls to external routines to stubs.
1428 The work of actually applying the relocation is left to a helper
1429 routine in an attempt to reduce the complexity and size of this
1432 static bfd_reloc_status_type
1433 elf_hppa_final_link_relocate (rel
, input_bfd
, output_bfd
,
1434 input_section
, contents
, value
,
1435 info
, sym_sec
, h
, dyn_h
)
1436 Elf_Internal_Rela
*rel
;
1439 asection
*input_section
;
1442 struct bfd_link_info
*info
;
1444 struct elf_link_hash_entry
*h
;
1445 struct elf64_hppa_dyn_hash_entry
*dyn_h
;
1448 bfd_vma offset
= rel
->r_offset
;
1449 bfd_vma addend
= rel
->r_addend
;
1450 reloc_howto_type
*howto
= elf_hppa_howto_table
+ ELF_R_TYPE (rel
->r_info
);
1451 unsigned int r_type
= howto
->type
;
1452 bfd_byte
*hit_data
= contents
+ offset
;
1453 struct elf64_hppa_link_hash_table
*hppa_info
= elf64_hppa_hash_table (info
);
1455 insn
= bfd_get_32 (input_bfd
, hit_data
);
1462 /* Basic function call support. I'm not entirely sure if PCREL14F is
1463 actually needed or even handled correctly.
1465 Note for a call to a function defined in another dynamic library
1466 we want to redirect the call to a stub. */
1468 /* Random PC relative relocs. */
1469 case R_PARISC_PCREL21L
:
1470 case R_PARISC_PCREL14R
:
1471 case R_PARISC_PCREL14F
:
1472 case R_PARISC_PCREL14WR
:
1473 case R_PARISC_PCREL14DR
:
1474 case R_PARISC_PCREL16F
:
1475 case R_PARISC_PCREL16WF
:
1476 case R_PARISC_PCREL16DF
:
1478 /* If this is a call to a function defined in another dynamic
1479 library, then redirect the call to the local stub for this
1481 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1482 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1483 + hppa_info
->stub_sec
->output_section
->vma
);
1485 /* Turn VALUE into a proper PC relative address. */
1486 value
-= (offset
+ input_section
->output_offset
1487 + input_section
->output_section
->vma
);
1489 /* Adjust for any field selectors. */
1490 if (r_type
== R_PARISC_PCREL21L
)
1491 value
= hppa_field_adjust (value
, -8 + addend
, e_lsel
);
1492 else if (r_type
== R_PARISC_PCREL14F
1493 || r_type
== R_PARISC_PCREL16F
1494 || r_type
== R_PARISC_PCREL16WF
1495 || r_type
== R_PARISC_PCREL16DF
)
1496 value
= hppa_field_adjust (value
, -8 + addend
, e_fsel
);
1498 value
= hppa_field_adjust (value
, -8 + addend
, e_rsel
);
1500 /* Apply the relocation to the given instruction. */
1501 insn
= elf_hppa_relocate_insn (insn
, value
, r_type
);
1505 case R_PARISC_PCREL22F
:
1506 case R_PARISC_PCREL17F
:
1507 case R_PARISC_PCREL22C
:
1508 case R_PARISC_PCREL17C
:
1509 case R_PARISC_PCREL17R
:
1511 /* If this is a call to a function defined in another dynamic
1512 library, then redirect the call to the local stub for this
1514 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1515 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1516 + hppa_info
->stub_sec
->output_section
->vma
);
1518 /* Turn VALUE into a proper PC relative address. */
1519 value
-= (offset
+ input_section
->output_offset
1520 + input_section
->output_section
->vma
);
1522 /* Adjust for any field selectors. */
1523 value
= hppa_field_adjust (value
, -8 + addend
, e_fsel
);
1525 /* All branches are implicitly shifted by 2 places. */
1528 /* Apply the relocation to the given instruction. */
1529 insn
= elf_hppa_relocate_insn (insn
, value
, r_type
);
1533 /* Indirect references to data through the DLT. */
1534 case R_PARISC_DLTIND14R
:
1535 case R_PARISC_DLTIND14F
:
1536 case R_PARISC_DLTIND14DR
:
1537 case R_PARISC_DLTIND14WR
:
1538 case R_PARISC_DLTIND21L
:
1539 case R_PARISC_LTOFF_FPTR14R
:
1540 case R_PARISC_LTOFF_FPTR14DR
:
1541 case R_PARISC_LTOFF_FPTR14WR
:
1542 case R_PARISC_LTOFF_FPTR21L
:
1543 case R_PARISC_LTOFF_FPTR16F
:
1544 case R_PARISC_LTOFF_FPTR16WF
:
1545 case R_PARISC_LTOFF_FPTR16DF
:
1546 case R_PARISC_LTOFF_TP21L
:
1547 case R_PARISC_LTOFF_TP14R
:
1548 case R_PARISC_LTOFF_TP14F
:
1549 case R_PARISC_LTOFF_TP14WR
:
1550 case R_PARISC_LTOFF_TP14DR
:
1551 case R_PARISC_LTOFF_TP16F
:
1552 case R_PARISC_LTOFF_TP16WF
:
1553 case R_PARISC_LTOFF_TP16DF
:
1554 case R_PARISC_LTOFF16F
:
1555 case R_PARISC_LTOFF16WF
:
1556 case R_PARISC_LTOFF16DF
:
1558 /* If this relocation was against a local symbol, then we still
1559 have not set up the DLT entry (it's not convienent to do so
1560 in the "finalize_dlt" routine because it is difficult to get
1561 to the local symbol's value).
1563 So, if this is a local symbol (h == NULL), then we need to
1564 fill in its DLT entry.
1566 Similarly we may still need to set up an entry in .opd for
1567 a local function which had its address taken. */
1568 if (dyn_h
->h
== NULL
)
1570 bfd_put_64 (hppa_info
->dlt_sec
->owner
,
1572 hppa_info
->dlt_sec
->contents
+ dyn_h
->dlt_offset
);
1574 /* Now handle .opd creation if needed. */
1575 if (r_type
== R_PARISC_LTOFF_FPTR14R
1576 || r_type
== R_PARISC_LTOFF_FPTR14DR
1577 || r_type
== R_PARISC_LTOFF_FPTR14WR
1578 || r_type
== R_PARISC_LTOFF_FPTR21L
1579 || r_type
== R_PARISC_LTOFF_FPTR16F
1580 || r_type
== R_PARISC_LTOFF_FPTR16WF
1581 || r_type
== R_PARISC_LTOFF_FPTR16DF
)
1583 /* The first two words of an .opd entry are zero. */
1584 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
,
1587 /* The next word is the address of the function. */
1588 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1589 (hppa_info
->opd_sec
->contents
1590 + dyn_h
->opd_offset
+ 16));
1592 /* The last word is our local __gp value. */
1593 value
= _bfd_get_gp_value
1594 (hppa_info
->opd_sec
->output_section
->owner
);
1595 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1596 (hppa_info
->opd_sec
->contents
1597 + dyn_h
->opd_offset
+ 24));
1601 /* We want the value of the DLT offset for this symbol, not
1602 the symbol's actual address. Note that __gp may not point
1603 to the start of the DLT, so we have to compute the absolute
1604 address, then subtract out the value of __gp. */
1605 value
= (dyn_h
->dlt_offset
1606 + hppa_info
->dlt_sec
->output_offset
1607 + hppa_info
->dlt_sec
->output_section
->vma
);
1608 value
-= _bfd_get_gp_value (output_bfd
);
1610 /* All DLTIND relocations are basically the same at this point,
1611 except that we need different field selectors for the 21bit
1612 version vs the 14bit versions. */
1613 if (r_type
== R_PARISC_DLTIND21L
1614 || r_type
== R_PARISC_LTOFF_FPTR21L
1615 || r_type
== R_PARISC_LTOFF_TP21L
)
1616 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1617 else if (r_type
== R_PARISC_DLTIND14F
1618 || r_type
== R_PARISC_LTOFF_FPTR16F
1619 || r_type
== R_PARISC_LTOFF_FPTR16WF
1620 || r_type
== R_PARISC_LTOFF_FPTR16DF
1621 || r_type
== R_PARISC_LTOFF16F
1622 || r_type
== R_PARISC_LTOFF16DF
1623 || r_type
== R_PARISC_LTOFF16WF
1624 || r_type
== R_PARISC_LTOFF_TP16F
1625 || r_type
== R_PARISC_LTOFF_TP16WF
1626 || r_type
== R_PARISC_LTOFF_TP16DF
)
1627 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1629 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1631 insn
= elf_hppa_relocate_insn (insn
, value
, r_type
);
1635 case R_PARISC_DLTREL14R
:
1636 case R_PARISC_DLTREL14F
:
1637 case R_PARISC_DLTREL14DR
:
1638 case R_PARISC_DLTREL14WR
:
1639 case R_PARISC_DLTREL21L
:
1640 case R_PARISC_DPREL21L
:
1641 case R_PARISC_DPREL14WR
:
1642 case R_PARISC_DPREL14DR
:
1643 case R_PARISC_DPREL14R
:
1644 case R_PARISC_DPREL14F
:
1645 case R_PARISC_GPREL16F
:
1646 case R_PARISC_GPREL16WF
:
1647 case R_PARISC_GPREL16DF
:
1649 /* Subtract out the global pointer value to make value a DLT
1650 relative address. */
1651 value
-= _bfd_get_gp_value (output_bfd
);
1653 /* All DLTREL relocations are basically the same at this point,
1654 except that we need different field selectors for the 21bit
1655 version vs the 14bit versions. */
1656 if (r_type
== R_PARISC_DLTREL21L
1657 || r_type
== R_PARISC_DPREL21L
)
1658 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1659 else if (r_type
== R_PARISC_DLTREL14F
1660 || r_type
== R_PARISC_DPREL14F
1661 || r_type
== R_PARISC_GPREL16F
1662 || r_type
== R_PARISC_GPREL16WF
1663 || r_type
== R_PARISC_GPREL16DF
)
1664 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1666 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1668 insn
= elf_hppa_relocate_insn (insn
, value
, r_type
);
1672 case R_PARISC_DIR21L
:
1673 case R_PARISC_DIR17R
:
1674 case R_PARISC_DIR17F
:
1675 case R_PARISC_DIR14R
:
1676 case R_PARISC_DIR14WR
:
1677 case R_PARISC_DIR14DR
:
1678 case R_PARISC_DIR16F
:
1679 case R_PARISC_DIR16WF
:
1680 case R_PARISC_DIR16DF
:
1682 /* All DIR relocations are basically the same at this point,
1683 except that we need different field selectors for the 21bit
1684 version vs the 14bit versions. */
1686 if (r_type
== R_PARISC_DIR21L
)
1687 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1688 else if (r_type
== R_PARISC_DIR17F
1689 || r_type
== R_PARISC_DIR16F
1690 || r_type
== R_PARISC_DIR16WF
1691 || r_type
== R_PARISC_DIR16DF
)
1692 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1694 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1696 insn
= elf_hppa_relocate_insn (insn
, value
, r_type
);
1700 case R_PARISC_PLTOFF21L
:
1701 case R_PARISC_PLTOFF14R
:
1702 case R_PARISC_PLTOFF14F
:
1703 case R_PARISC_PLTOFF14WR
:
1704 case R_PARISC_PLTOFF14DR
:
1705 case R_PARISC_PLTOFF16F
:
1706 case R_PARISC_PLTOFF16WF
:
1707 case R_PARISC_PLTOFF16DF
:
1709 /* We want the value of the PLT offset for this symbol, not
1710 the symbol's actual address. Note that __gp may not point
1711 to the start of the DLT, so we have to compute the absolute
1712 address, then subtract out the value of __gp. */
1713 value
= (dyn_h
->plt_offset
1714 + hppa_info
->plt_sec
->output_offset
1715 + hppa_info
->plt_sec
->output_section
->vma
);
1716 value
-= _bfd_get_gp_value (output_bfd
);
1718 /* All PLTOFF relocations are basically the same at this point,
1719 except that we need different field selectors for the 21bit
1720 version vs the 14bit versions. */
1721 if (r_type
== R_PARISC_PLTOFF21L
)
1722 value
= hppa_field_adjust (value
, addend
, e_lrsel
);
1723 else if (r_type
== R_PARISC_PLTOFF14F
1724 || r_type
== R_PARISC_PLTOFF16F
1725 || r_type
== R_PARISC_PLTOFF16WF
1726 || r_type
== R_PARISC_PLTOFF16DF
)
1727 value
= hppa_field_adjust (value
, addend
, e_fsel
);
1729 value
= hppa_field_adjust (value
, addend
, e_rrsel
);
1731 insn
= elf_hppa_relocate_insn (insn
, value
, r_type
);
1735 case R_PARISC_LTOFF_FPTR32
:
1737 /* We may still need to create the FPTR itself if it was for
1739 if (dyn_h
->h
== NULL
)
1741 /* The first two words of an .opd entry are zero. */
1742 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
, 0, 16);
1744 /* The next word is the address of the function. */
1745 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1746 (hppa_info
->opd_sec
->contents
1747 + dyn_h
->opd_offset
+ 16));
1749 /* The last word is our local __gp value. */
1750 value
= _bfd_get_gp_value
1751 (hppa_info
->opd_sec
->output_section
->owner
);
1752 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1753 hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
+ 24);
1756 /* We want the value of the DLT offset for this symbol, not
1757 the symbol's actual address. Note that __gp may not point
1758 to the start of the DLT, so we have to compute the absolute
1759 address, then subtract out the value of __gp. */
1760 value
= (dyn_h
->dlt_offset
1761 + hppa_info
->dlt_sec
->output_offset
1762 + hppa_info
->dlt_sec
->output_section
->vma
);
1763 value
-= _bfd_get_gp_value (output_bfd
);
1764 bfd_put_32 (input_bfd
, value
, hit_data
);
1765 return bfd_reloc_ok
;
1768 case R_PARISC_LTOFF_FPTR64
:
1769 case R_PARISC_LTOFF_TP64
:
1771 /* We may still need to create the FPTR itself if it was for
1773 if (dyn_h
->h
== NULL
&& r_type
== R_PARISC_LTOFF_FPTR64
)
1775 /* The first two words of an .opd entry are zero. */
1776 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
, 0, 16);
1778 /* The next word is the address of the function. */
1779 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1780 (hppa_info
->opd_sec
->contents
1781 + dyn_h
->opd_offset
+ 16));
1783 /* The last word is our local __gp value. */
1784 value
= _bfd_get_gp_value
1785 (hppa_info
->opd_sec
->output_section
->owner
);
1786 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1787 hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
+ 24);
1790 /* We want the value of the DLT offset for this symbol, not
1791 the symbol's actual address. Note that __gp may not point
1792 to the start of the DLT, so we have to compute the absolute
1793 address, then subtract out the value of __gp. */
1794 value
= (dyn_h
->dlt_offset
1795 + hppa_info
->dlt_sec
->output_offset
1796 + hppa_info
->dlt_sec
->output_section
->vma
);
1797 value
-= _bfd_get_gp_value (output_bfd
);
1798 bfd_put_64 (input_bfd
, value
, hit_data
);
1799 return bfd_reloc_ok
;
1802 case R_PARISC_DIR32
:
1803 bfd_put_32 (input_bfd
, value
+ addend
, hit_data
);
1804 return bfd_reloc_ok
;
1806 case R_PARISC_DIR64
:
1807 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1808 return bfd_reloc_ok
;
1810 case R_PARISC_GPREL64
:
1811 /* Subtract out the global pointer value to make value a DLT
1812 relative address. */
1813 value
-= _bfd_get_gp_value (output_bfd
);
1816 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1817 return bfd_reloc_ok
;
1819 case R_PARISC_LTOFF64
:
1820 /* We want the value of the DLT offset for this symbol, not
1821 the symbol's actual address. Note that __gp may not point
1822 to the start of the DLT, so we have to compute the absolute
1823 address, then subtract out the value of __gp. */
1824 value
= (dyn_h
->dlt_offset
1825 + hppa_info
->dlt_sec
->output_offset
1826 + hppa_info
->dlt_sec
->output_section
->vma
);
1827 value
-= _bfd_get_gp_value (output_bfd
);
1829 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1830 return bfd_reloc_ok
;
1832 case R_PARISC_PCREL32
:
1834 /* If this is a call to a function defined in another dynamic
1835 library, then redirect the call to the local stub for this
1837 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1838 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1839 + hppa_info
->stub_sec
->output_section
->vma
);
1841 /* Turn VALUE into a proper PC relative address. */
1842 value
-= (offset
+ input_section
->output_offset
1843 + input_section
->output_section
->vma
);
1847 bfd_put_64 (input_bfd
, value
, hit_data
);
1848 return bfd_reloc_ok
;
1851 case R_PARISC_PCREL64
:
1853 /* If this is a call to a function defined in another dynamic
1854 library, then redirect the call to the local stub for this
1856 if (sym_sec
== NULL
|| sym_sec
->output_section
== NULL
)
1857 value
= (dyn_h
->stub_offset
+ hppa_info
->stub_sec
->output_offset
1858 + hppa_info
->stub_sec
->output_section
->vma
);
1861 /* Turn VALUE into a proper PC relative address. */
1862 value
-= (offset
+ input_section
->output_offset
1863 + input_section
->output_section
->vma
);
1867 bfd_put_64 (input_bfd
, value
, hit_data
);
1868 return bfd_reloc_ok
;
1872 case R_PARISC_FPTR64
:
1874 /* We may still need to create the FPTR itself if it was for
1876 if (dyn_h
->h
== NULL
)
1878 /* The first two words of an .opd entry are zero. */
1879 memset (hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
, 0, 16);
1881 /* The next word is the address of the function. */
1882 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1883 (hppa_info
->opd_sec
->contents
1884 + dyn_h
->opd_offset
+ 16));
1886 /* The last word is our local __gp value. */
1887 value
= _bfd_get_gp_value
1888 (hppa_info
->opd_sec
->output_section
->owner
);
1889 bfd_put_64 (hppa_info
->opd_sec
->owner
, value
,
1890 hppa_info
->opd_sec
->contents
+ dyn_h
->opd_offset
+ 24);
1893 /* We want the value of the OPD offset for this symbol, not
1894 the symbol's actual address. */
1895 value
= (dyn_h
->opd_offset
1896 + hppa_info
->opd_sec
->output_offset
1897 + hppa_info
->opd_sec
->output_section
->vma
);
1899 bfd_put_64 (input_bfd
, value
+ addend
, hit_data
);
1900 return bfd_reloc_ok
;
1903 case R_PARISC_SECREL32
:
1904 bfd_put_32 (input_bfd
,
1906 - sym_sec
->output_section
->vma
),
1908 return bfd_reloc_ok
;
1910 case R_PARISC_SEGREL32
:
1911 case R_PARISC_SEGREL64
:
1913 /* If this is the first SEGREL relocation, then initialize
1914 the segment base values. */
1915 if (hppa_info
->text_segment_base
== (bfd_vma
) -1)
1916 bfd_map_over_sections (output_bfd
, elf_hppa_record_segment_addrs
,
1917 elf64_hppa_hash_table (info
));
1919 /* VALUE holds the absolute address. We want to include the
1920 addend, then turn it into a segment relative address.
1922 The segment is derived from SYM_SEC. We assume that there are
1923 only two segments of note in the resulting executable/shlib.
1924 A readonly segment (.text) and a readwrite segment (.data). */
1927 if (sym_sec
->flags
& SEC_CODE
)
1928 value
-= hppa_info
->text_segment_base
;
1930 value
-= hppa_info
->data_segment_base
;
1932 if (r_type
== R_PARISC_SEGREL32
)
1933 bfd_put_32 (input_bfd
, value
, hit_data
);
1935 bfd_put_64 (input_bfd
, value
, hit_data
);
1936 return bfd_reloc_ok
;
1940 /* Something we don't know how to handle. */
1942 return bfd_reloc_notsupported
;
1945 /* Update the instruction word. */
1946 bfd_put_32 (input_bfd
, insn
, hit_data
);
1947 return (bfd_reloc_ok
);
1950 /* Relocate the given INSN. VALUE should be the actual value we want
1951 to insert into the instruction, ie by this point we should not be
1952 concerned with computing an offset relative to the DLT, PC, etc.
1953 Instead this routine is meant to handle the bit manipulations needed
1954 to insert the relocation into the given instruction. */
1957 elf_hppa_relocate_insn (insn
, sym_value
, r_type
)
1959 unsigned int sym_value
;
1960 unsigned int r_type
;
1964 /* This is any 22bit branch. In PA2.0 syntax it corresponds to
1965 the "B" instruction. */
1966 case R_PARISC_PCREL22F
:
1967 case R_PARISC_PCREL22C
:
1968 return re_assemble_22 (insn
& ~ 0x3ff1ffd, sym_value
);
1970 /* This is any 17bit branch. In PA2.0 syntax it also corresponds to
1971 the "B" instruction as well as BE. */
1972 case R_PARISC_PCREL17F
:
1973 case R_PARISC_DIR17F
:
1974 case R_PARISC_DIR17R
:
1975 case R_PARISC_PCREL17C
:
1976 case R_PARISC_PCREL17R
:
1977 return re_assemble_17 (insn
& ~ 0x1f1ffd, sym_value
);
1979 /* ADDIL or LDIL instructions. */
1980 case R_PARISC_DLTREL21L
:
1981 case R_PARISC_DLTIND21L
:
1982 case R_PARISC_LTOFF_FPTR21L
:
1983 case R_PARISC_PCREL21L
:
1984 case R_PARISC_LTOFF_TP21L
:
1985 case R_PARISC_DPREL21L
:
1986 case R_PARISC_PLTOFF21L
:
1987 case R_PARISC_DIR21L
:
1988 return re_assemble_21 (insn
& ~ 0x1fffff, sym_value
);
1990 /* LDO and integer loads/stores with 14bit displacements. */
1991 case R_PARISC_DLTREL14R
:
1992 case R_PARISC_DLTREL14F
:
1993 case R_PARISC_DLTIND14R
:
1994 case R_PARISC_DLTIND14F
:
1995 case R_PARISC_LTOFF_FPTR14R
:
1996 case R_PARISC_LTOFF_FPTR16F
:
1997 case R_PARISC_PCREL14R
:
1998 case R_PARISC_PCREL14F
:
1999 case R_PARISC_PCREL16F
:
2000 case R_PARISC_LTOFF_TP14R
:
2001 case R_PARISC_LTOFF_TP14F
:
2002 case R_PARISC_LTOFF_TP16F
:
2003 case R_PARISC_DPREL14R
:
2004 case R_PARISC_DPREL14F
:
2005 case R_PARISC_GPREL16F
:
2006 case R_PARISC_PLTOFF14R
:
2007 case R_PARISC_PLTOFF14F
:
2008 case R_PARISC_PLTOFF16F
:
2009 case R_PARISC_DIR14R
:
2010 case R_PARISC_DIR16F
:
2011 case R_PARISC_LTOFF16F
:
2012 return (insn
& ~ 0x3fff) | low_sign_unext (sym_value
, 14);
2014 /* Doubleword loads and stores with a 14bit displacement. */
2015 case R_PARISC_DLTREL14DR
:
2016 case R_PARISC_DLTIND14DR
:
2017 case R_PARISC_LTOFF_FPTR14DR
:
2018 case R_PARISC_LTOFF_FPTR16DF
:
2019 case R_PARISC_PCREL14DR
:
2020 case R_PARISC_PCREL16DF
:
2021 case R_PARISC_LTOFF_TP14DR
:
2022 case R_PARISC_LTOFF_TP16DF
:
2023 case R_PARISC_DPREL14DR
:
2024 case R_PARISC_GPREL16DF
:
2025 case R_PARISC_PLTOFF14DR
:
2026 case R_PARISC_PLTOFF16DF
:
2027 case R_PARISC_DIR14DR
:
2028 case R_PARISC_DIR16DF
:
2029 case R_PARISC_LTOFF16DF
:
2030 return (insn
& ~ 0x3ff1) | (((sym_value
& 0x2000) >> 13)
2031 | ((sym_value
& 0x1ff8) << 1));
2033 /* Floating point single word load/store instructions. */
2034 case R_PARISC_DLTREL14WR
:
2035 case R_PARISC_DLTIND14WR
:
2036 case R_PARISC_LTOFF_FPTR14WR
:
2037 case R_PARISC_LTOFF_FPTR16WF
:
2038 case R_PARISC_PCREL14WR
:
2039 case R_PARISC_PCREL16WF
:
2040 case R_PARISC_LTOFF_TP14WR
:
2041 case R_PARISC_LTOFF_TP16WF
:
2042 case R_PARISC_DPREL14WR
:
2043 case R_PARISC_GPREL16WF
:
2044 case R_PARISC_PLTOFF14WR
:
2045 case R_PARISC_PLTOFF16WF
:
2046 case R_PARISC_DIR16WF
:
2047 case R_PARISC_DIR14WR
:
2048 case R_PARISC_LTOFF16WF
:
2049 return (insn
& ~ 0x3ff9) | (((sym_value
& 0x2000) >> 13)
2050 | ((sym_value
& 0x1ffc) << 1));