Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* Target definitions for NN-bit ELF |
f0abc2a1 | 2 | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
72adc230 | 3 | 2003, 2004 Free Software Foundation, Inc. |
252b5132 | 4 | |
5e8d7549 | 5 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 6 | |
5e8d7549 NC |
7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
252b5132 | 11 | |
5e8d7549 NC |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
252b5132 | 16 | |
5e8d7549 NC |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
252b5132 RH |
20 | |
21 | /* This structure contains everything that BFD knows about a target. | |
22 | It includes things like its byte order, name, what routines to call | |
23 | to do various operations, etc. Every BFD points to a target structure | |
24 | with its "xvec" member. | |
25 | ||
26 | There are two such structures here: one for big-endian machines and | |
27 | one for little-endian machines. */ | |
28 | ||
29 | #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup | |
30 | #define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info | |
31 | #ifndef bfd_elfNN_get_section_contents | |
32 | #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents | |
33 | #endif | |
34 | ||
e656e369 AM |
35 | #define bfd_elfNN_canonicalize_dynamic_symtab \ |
36 | _bfd_elf_canonicalize_dynamic_symtab | |
4c45e5c9 JJ |
37 | #define bfd_elfNN_get_synthetic_symtab \ |
38 | _bfd_elf_get_synthetic_symtab | |
fee24f1c | 39 | #ifndef bfd_elfNN_canonicalize_reloc |
252b5132 | 40 | #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc |
fee24f1c | 41 | #endif |
252b5132 RH |
42 | #ifndef bfd_elfNN_find_nearest_line |
43 | #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line | |
44 | #endif | |
45 | #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols | |
46 | #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol | |
e656e369 AM |
47 | #define bfd_elfNN_get_dynamic_symtab_upper_bound \ |
48 | _bfd_elf_get_dynamic_symtab_upper_bound | |
252b5132 RH |
49 | #define bfd_elfNN_get_lineno _bfd_elf_get_lineno |
50 | #ifndef bfd_elfNN_get_reloc_upper_bound | |
51 | #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound | |
52 | #endif | |
7cdc5bba | 53 | #ifndef bfd_elfNN_get_symbol_info |
252b5132 | 54 | #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info |
7cdc5bba | 55 | #endif |
6cee3f79 | 56 | #define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab |
252b5132 | 57 | #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound |
252b5132 | 58 | #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol |
f0abc2a1 | 59 | #ifndef bfd_elfNN_new_section_hook |
252b5132 | 60 | #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook |
f0abc2a1 | 61 | #endif |
252b5132 RH |
62 | #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach |
63 | #ifndef bfd_elfNN_set_section_contents | |
64 | #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents | |
65 | #endif | |
66 | #define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers | |
67 | #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents | |
68 | #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents | |
69 | ||
70 | #define bfd_elfNN_get_section_contents_in_window \ | |
71 | _bfd_generic_get_section_contents_in_window | |
72 | ||
73 | #ifndef elf_backend_got_symbol_offset | |
74 | #define elf_backend_got_symbol_offset (bfd_vma) 0 | |
75 | #endif | |
3c3bdf30 NC |
76 | #ifndef elf_backend_can_refcount |
77 | #define elf_backend_can_refcount 0 | |
78 | #endif | |
252b5132 RH |
79 | #ifndef elf_backend_want_got_plt |
80 | #define elf_backend_want_got_plt 0 | |
81 | #endif | |
82 | #ifndef elf_backend_plt_readonly | |
83 | #define elf_backend_plt_readonly 0 | |
84 | #endif | |
85 | #ifndef elf_backend_want_plt_sym | |
86 | #define elf_backend_want_plt_sym 0 | |
87 | #endif | |
88 | #ifndef elf_backend_plt_not_loaded | |
89 | #define elf_backend_plt_not_loaded 0 | |
90 | #endif | |
91 | #ifndef elf_backend_plt_alignment | |
92 | #define elf_backend_plt_alignment 2 | |
93 | #endif | |
3018b441 RH |
94 | #ifndef elf_backend_want_dynbss |
95 | #define elf_backend_want_dynbss 1 | |
96 | #endif | |
5e8d7549 NC |
97 | #ifndef elf_backend_want_p_paddr_set_to_zero |
98 | #define elf_backend_want_p_paddr_set_to_zero 0 | |
99 | #endif | |
252b5132 RH |
100 | |
101 | #define bfd_elfNN_bfd_debug_info_start bfd_void | |
102 | #define bfd_elfNN_bfd_debug_info_end bfd_void | |
dc810e39 | 103 | #define bfd_elfNN_bfd_debug_info_accumulate \ |
198beae2 | 104 | ((void (*) (bfd*, struct bfd_section *)) bfd_void) |
252b5132 RH |
105 | |
106 | #ifndef bfd_elfNN_bfd_get_relocated_section_contents | |
107 | #define bfd_elfNN_bfd_get_relocated_section_contents \ | |
e656e369 | 108 | bfd_generic_get_relocated_section_contents |
252b5132 RH |
109 | #endif |
110 | ||
111 | #ifndef bfd_elfNN_bfd_relax_section | |
112 | #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section | |
113 | #endif | |
114 | ||
115 | #ifndef elf_backend_can_gc_sections | |
116 | #define elf_backend_can_gc_sections 0 | |
117 | #endif | |
51b64d56 AM |
118 | #ifndef elf_backend_can_refcount |
119 | #define elf_backend_can_refcount 0 | |
120 | #endif | |
2517a57f AM |
121 | #ifndef elf_backend_want_got_sym |
122 | #define elf_backend_want_got_sym 1 | |
123 | #endif | |
252b5132 RH |
124 | #ifndef elf_backend_gc_mark_hook |
125 | #define elf_backend_gc_mark_hook NULL | |
126 | #endif | |
127 | #ifndef elf_backend_gc_sweep_hook | |
128 | #define elf_backend_gc_sweep_hook NULL | |
129 | #endif | |
130 | #ifndef bfd_elfNN_bfd_gc_sections | |
c152c796 | 131 | #define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections |
252b5132 RH |
132 | #endif |
133 | ||
8550eb6e JJ |
134 | #ifndef bfd_elfNN_bfd_merge_sections |
135 | #define bfd_elfNN_bfd_merge_sections \ | |
136 | _bfd_elf_merge_sections | |
137 | #endif | |
138 | ||
72adc230 AM |
139 | #ifndef bfd_elfNN_bfd_is_group_section |
140 | #define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section | |
141 | #endif | |
142 | ||
e61463e1 AM |
143 | #ifndef bfd_elfNN_bfd_discard_group |
144 | #define bfd_elfNN_bfd_discard_group bfd_elf_discard_group | |
145 | #endif | |
146 | ||
d1cf510e | 147 | #ifndef bfd_elfNN_bfd_make_debug_symbol |
252b5132 | 148 | #define bfd_elfNN_bfd_make_debug_symbol \ |
e656e369 | 149 | ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) |
d1cf510e | 150 | #endif |
252b5132 RH |
151 | |
152 | #ifndef bfd_elfNN_bfd_copy_private_symbol_data | |
153 | #define bfd_elfNN_bfd_copy_private_symbol_data \ | |
154 | _bfd_elf_copy_private_symbol_data | |
155 | #endif | |
156 | ||
157 | #ifndef bfd_elfNN_bfd_copy_private_section_data | |
158 | #define bfd_elfNN_bfd_copy_private_section_data \ | |
159 | _bfd_elf_copy_private_section_data | |
160 | #endif | |
161 | #ifndef bfd_elfNN_bfd_copy_private_bfd_data | |
162 | #define bfd_elfNN_bfd_copy_private_bfd_data \ | |
2d502050 | 163 | _bfd_elf_copy_private_bfd_data |
252b5132 RH |
164 | #endif |
165 | #ifndef bfd_elfNN_bfd_print_private_bfd_data | |
166 | #define bfd_elfNN_bfd_print_private_bfd_data \ | |
167 | _bfd_elf_print_private_bfd_data | |
168 | #endif | |
169 | #ifndef bfd_elfNN_bfd_merge_private_bfd_data | |
170 | #define bfd_elfNN_bfd_merge_private_bfd_data \ | |
e656e369 | 171 | ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) |
252b5132 RH |
172 | #endif |
173 | #ifndef bfd_elfNN_bfd_set_private_flags | |
174 | #define bfd_elfNN_bfd_set_private_flags \ | |
e656e369 | 175 | ((bfd_boolean (*) (bfd *, flagword)) bfd_true) |
252b5132 RH |
176 | #endif |
177 | #ifndef bfd_elfNN_bfd_is_local_label_name | |
178 | #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name | |
179 | #endif | |
180 | ||
181 | #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound | |
182 | #define bfd_elfNN_get_dynamic_reloc_upper_bound \ | |
183 | _bfd_elf_get_dynamic_reloc_upper_bound | |
184 | #endif | |
185 | #ifndef bfd_elfNN_canonicalize_dynamic_reloc | |
186 | #define bfd_elfNN_canonicalize_dynamic_reloc \ | |
187 | _bfd_elf_canonicalize_dynamic_reloc | |
188 | #endif | |
189 | ||
e2d34d7d DJ |
190 | #ifndef bfd_elfNN_bfd_link_hash_table_free |
191 | #define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free | |
192 | #endif | |
193 | ||
8ea2e4bd | 194 | #ifdef elf_backend_relocate_section |
252b5132 RH |
195 | #ifndef bfd_elfNN_bfd_link_hash_table_create |
196 | #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create | |
197 | #endif | |
4ad4eba5 AM |
198 | #ifndef bfd_elfNN_bfd_link_add_symbols |
199 | #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols | |
200 | #endif | |
c152c796 AM |
201 | #ifndef bfd_elfNN_bfd_final_link |
202 | #define bfd_elfNN_bfd_final_link bfd_elf_final_link | |
203 | #endif | |
8ea2e4bd NC |
204 | #else /* ! defined (elf_backend_relocate_section) */ |
205 | /* If no backend relocate_section routine, use the generic linker. | |
206 | Note - this will prevent the port from being able to use some of | |
207 | the other features of the ELF linker, because the generic hash structure | |
208 | does not have the fields needed by the ELF linker. In particular it | |
209 | means that linking directly to S-records will not work. */ | |
210 | #ifndef bfd_elfNN_bfd_link_hash_table_create | |
211 | #define bfd_elfNN_bfd_link_hash_table_create \ | |
212 | _bfd_generic_link_hash_table_create | |
213 | #endif | |
252b5132 RH |
214 | #ifndef bfd_elfNN_bfd_link_add_symbols |
215 | #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols | |
216 | #endif | |
217 | #ifndef bfd_elfNN_bfd_final_link | |
218 | #define bfd_elfNN_bfd_final_link _bfd_generic_final_link | |
219 | #endif | |
220 | #endif /* ! defined (elf_backend_relocate_section) */ | |
2d653fc7 AM |
221 | |
222 | #ifndef bfd_elfNN_bfd_link_just_syms | |
223 | #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms | |
224 | #endif | |
225 | ||
252b5132 RH |
226 | #ifndef bfd_elfNN_bfd_link_split_section |
227 | #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section | |
228 | #endif | |
229 | ||
230 | #ifndef bfd_elfNN_archive_p | |
231 | #define bfd_elfNN_archive_p bfd_generic_archive_p | |
232 | #endif | |
233 | ||
234 | #ifndef bfd_elfNN_write_archive_contents | |
235 | #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents | |
236 | #endif | |
237 | ||
238 | #ifndef bfd_elfNN_mkobject | |
239 | #define bfd_elfNN_mkobject bfd_elf_mkobject | |
240 | #endif | |
241 | ||
242 | #ifndef bfd_elfNN_mkcorefile | |
243 | #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile | |
244 | #endif | |
245 | ||
246 | #ifndef bfd_elfNN_mkarchive | |
247 | #define bfd_elfNN_mkarchive _bfd_generic_mkarchive | |
248 | #endif | |
249 | ||
c152c796 AM |
250 | #ifndef bfd_elfNN_print_symbol |
251 | #define bfd_elfNN_print_symbol bfd_elf_print_symbol | |
252 | #endif | |
253 | ||
252b5132 RH |
254 | #ifndef elf_symbol_leading_char |
255 | #define elf_symbol_leading_char 0 | |
256 | #endif | |
257 | ||
258 | #ifndef elf_info_to_howto | |
259 | #define elf_info_to_howto 0 | |
260 | #endif | |
261 | ||
262 | #ifndef elf_info_to_howto_rel | |
263 | #define elf_info_to_howto_rel 0 | |
264 | #endif | |
265 | ||
266 | #ifndef ELF_MAXPAGESIZE | |
79e5982f NC |
267 | #error ELF_MAXPAGESIZE is not defined |
268 | #define ELF_MAXPAGESIZE 1 | |
252b5132 RH |
269 | #endif |
270 | ||
271 | #ifndef elf_backend_collect | |
b34976b6 | 272 | #define elf_backend_collect FALSE |
252b5132 RH |
273 | #endif |
274 | #ifndef elf_backend_type_change_ok | |
b34976b6 | 275 | #define elf_backend_type_change_ok FALSE |
252b5132 RH |
276 | #endif |
277 | ||
278 | #ifndef elf_backend_sym_is_global | |
279 | #define elf_backend_sym_is_global 0 | |
280 | #endif | |
281 | #ifndef elf_backend_object_p | |
282 | #define elf_backend_object_p 0 | |
283 | #endif | |
284 | #ifndef elf_backend_symbol_processing | |
285 | #define elf_backend_symbol_processing 0 | |
286 | #endif | |
287 | #ifndef elf_backend_symbol_table_processing | |
288 | #define elf_backend_symbol_table_processing 0 | |
289 | #endif | |
290 | #ifndef elf_backend_get_symbol_type | |
291 | #define elf_backend_get_symbol_type 0 | |
292 | #endif | |
174fd7f9 RS |
293 | #ifndef elf_backend_name_local_section_symbols |
294 | #define elf_backend_name_local_section_symbols 0 | |
295 | #endif | |
252b5132 RH |
296 | #ifndef elf_backend_section_processing |
297 | #define elf_backend_section_processing 0 | |
298 | #endif | |
299 | #ifndef elf_backend_section_from_shdr | |
300 | #define elf_backend_section_from_shdr 0 | |
301 | #endif | |
fa152c49 JW |
302 | #ifndef elf_backend_section_flags |
303 | #define elf_backend_section_flags 0 | |
304 | #endif | |
20cfcaae NC |
305 | #ifndef elf_backend_section_from_phdr |
306 | #define elf_backend_section_from_phdr 0 | |
307 | #endif | |
252b5132 RH |
308 | #ifndef elf_backend_fake_sections |
309 | #define elf_backend_fake_sections 0 | |
310 | #endif | |
311 | #ifndef elf_backend_section_from_bfd_section | |
312 | #define elf_backend_section_from_bfd_section 0 | |
313 | #endif | |
314 | #ifndef elf_backend_add_symbol_hook | |
315 | #define elf_backend_add_symbol_hook 0 | |
316 | #endif | |
317 | #ifndef elf_backend_link_output_symbol_hook | |
318 | #define elf_backend_link_output_symbol_hook 0 | |
319 | #endif | |
320 | #ifndef elf_backend_create_dynamic_sections | |
321 | #define elf_backend_create_dynamic_sections 0 | |
322 | #endif | |
323 | #ifndef elf_backend_check_relocs | |
324 | #define elf_backend_check_relocs 0 | |
325 | #endif | |
326 | #ifndef elf_backend_adjust_dynamic_symbol | |
327 | #define elf_backend_adjust_dynamic_symbol 0 | |
328 | #endif | |
329 | #ifndef elf_backend_always_size_sections | |
330 | #define elf_backend_always_size_sections 0 | |
331 | #endif | |
332 | #ifndef elf_backend_size_dynamic_sections | |
333 | #define elf_backend_size_dynamic_sections 0 | |
334 | #endif | |
335 | #ifndef elf_backend_relocate_section | |
336 | #define elf_backend_relocate_section 0 | |
337 | #endif | |
338 | #ifndef elf_backend_finish_dynamic_symbol | |
339 | #define elf_backend_finish_dynamic_symbol 0 | |
340 | #endif | |
341 | #ifndef elf_backend_finish_dynamic_sections | |
342 | #define elf_backend_finish_dynamic_sections 0 | |
343 | #endif | |
344 | #ifndef elf_backend_begin_write_processing | |
345 | #define elf_backend_begin_write_processing 0 | |
346 | #endif | |
347 | #ifndef elf_backend_final_write_processing | |
348 | #define elf_backend_final_write_processing 0 | |
349 | #endif | |
350 | #ifndef elf_backend_additional_program_headers | |
351 | #define elf_backend_additional_program_headers 0 | |
352 | #endif | |
353 | #ifndef elf_backend_modify_segment_map | |
354 | #define elf_backend_modify_segment_map 0 | |
355 | #endif | |
356 | #ifndef elf_backend_ecoff_debug_swap | |
357 | #define elf_backend_ecoff_debug_swap 0 | |
358 | #endif | |
8d6337fe RM |
359 | #ifndef elf_backend_bfd_from_remote_memory |
360 | #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory | |
361 | #endif | |
252b5132 RH |
362 | #ifndef elf_backend_got_header_size |
363 | #define elf_backend_got_header_size 0 | |
364 | #endif | |
e6c51ed4 NC |
365 | #ifndef elf_backend_post_process_headers |
366 | #define elf_backend_post_process_headers NULL | |
367 | #endif | |
587ff49e RH |
368 | #ifndef elf_backend_print_symbol_all |
369 | #define elf_backend_print_symbol_all NULL | |
370 | #endif | |
371 | #ifndef elf_backend_output_arch_syms | |
372 | #define elf_backend_output_arch_syms NULL | |
373 | #endif | |
c61b8717 RH |
374 | #ifndef elf_backend_copy_indirect_symbol |
375 | #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect | |
376 | #endif | |
377 | #ifndef elf_backend_hide_symbol | |
378 | #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol | |
379 | #endif | |
9bf7216d KK |
380 | #ifndef elf_backend_merge_symbol_attribute |
381 | #define elf_backend_merge_symbol_attribute NULL | |
382 | #endif | |
9317eacc CM |
383 | #ifndef elf_backend_emit_relocs |
384 | #define elf_backend_emit_relocs NULL | |
385 | #endif | |
386 | #ifndef elf_backend_count_relocs | |
387 | #define elf_backend_count_relocs NULL | |
388 | #endif | |
bb0082d6 AM |
389 | #ifndef elf_backend_grok_prstatus |
390 | #define elf_backend_grok_prstatus NULL | |
391 | #endif | |
392 | #ifndef elf_backend_grok_psinfo | |
393 | #define elf_backend_grok_psinfo NULL | |
394 | #endif | |
4e771d61 NC |
395 | #ifndef elf_backend_sprintf_vma |
396 | #define elf_backend_sprintf_vma _bfd_elf_sprintf_vma | |
397 | #endif | |
398 | #ifndef elf_backend_fprintf_vma | |
399 | #define elf_backend_fprintf_vma _bfd_elf_fprintf_vma | |
400 | #endif | |
db6751f2 JJ |
401 | #ifndef elf_backend_reloc_type_class |
402 | #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class | |
403 | #endif | |
73d074b4 DJ |
404 | #ifndef elf_backend_discard_info |
405 | #define elf_backend_discard_info NULL | |
406 | #endif | |
407 | #ifndef elf_backend_ignore_discarded_relocs | |
408 | #define elf_backend_ignore_discarded_relocs NULL | |
409 | #endif | |
ec3391e7 AO |
410 | #ifndef elf_backend_can_make_relative_eh_frame |
411 | #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative | |
412 | #endif | |
413 | #ifndef elf_backend_can_make_lsda_relative_eh_frame | |
414 | #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative | |
415 | #endif | |
416 | #ifndef elf_backend_encode_eh_address | |
417 | #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address | |
418 | #endif | |
73d074b4 DJ |
419 | #ifndef elf_backend_write_section |
420 | #define elf_backend_write_section NULL | |
421 | #endif | |
c6e90b02 TS |
422 | #ifndef elf_backend_mips_irix_compat |
423 | #define elf_backend_mips_irix_compat NULL | |
424 | #endif | |
425 | #ifndef elf_backend_mips_rtype_to_howto | |
426 | #define elf_backend_mips_rtype_to_howto NULL | |
427 | #endif | |
c61b8717 | 428 | |
bf572ba0 MM |
429 | /* Previously, backends could only use SHT_REL or SHT_RELA relocation |
430 | sections, but not both. They defined USE_REL to indicate SHT_REL | |
431 | sections, and left it undefined to indicated SHT_RELA sections. | |
432 | For backwards compatibility, we still support this usage. */ | |
433 | #ifndef USE_REL | |
434 | #define USE_REL 0 | |
3e932841 | 435 | #endif |
bf572ba0 MM |
436 | |
437 | /* Use these in new code. */ | |
3e932841 | 438 | #ifndef elf_backend_may_use_rel_p |
bf572ba0 | 439 | #define elf_backend_may_use_rel_p USE_REL |
3e932841 | 440 | #endif |
bf572ba0 MM |
441 | #ifndef elf_backend_may_use_rela_p |
442 | #define elf_backend_may_use_rela_p !USE_REL | |
443 | #endif | |
3e932841 | 444 | #ifndef elf_backend_default_use_rela_p |
bf572ba0 MM |
445 | #define elf_backend_default_use_rela_p !USE_REL |
446 | #endif | |
447 | ||
b491616a AM |
448 | #ifndef elf_backend_rela_normal |
449 | #define elf_backend_rela_normal 0 | |
450 | #endif | |
451 | ||
4c45e5c9 JJ |
452 | #ifndef elf_backend_plt_sym_val |
453 | #define elf_backend_plt_sym_val NULL | |
454 | #endif | |
455 | #ifndef elf_backend_relplt_name | |
456 | #define elf_backend_relplt_name NULL | |
457 | #endif | |
458 | ||
252b5132 RH |
459 | #ifndef ELF_MACHINE_ALT1 |
460 | #define ELF_MACHINE_ALT1 0 | |
461 | #endif | |
462 | ||
463 | #ifndef ELF_MACHINE_ALT2 | |
464 | #define ELF_MACHINE_ALT2 0 | |
465 | #endif | |
466 | ||
467 | #ifndef elf_backend_size_info | |
468 | #define elf_backend_size_info _bfd_elfNN_size_info | |
469 | #endif | |
470 | ||
2f89ff8d L |
471 | #ifndef elf_backend_special_sections |
472 | #define elf_backend_special_sections NULL | |
473 | #endif | |
474 | ||
86dc0f79 RH |
475 | #ifndef elf_backend_sign_extend_vma |
476 | #define elf_backend_sign_extend_vma 0 | |
477 | #endif | |
478 | ||
252b5132 RH |
479 | extern const struct elf_size_info _bfd_elfNN_size_info; |
480 | ||
dd745cfa | 481 | #ifndef INCLUDED_TARGET_FILE |
dc810e39 | 482 | static const struct elf_backend_data elfNN_bed = |
252b5132 | 483 | { |
252b5132 RH |
484 | ELF_ARCH, /* arch */ |
485 | ELF_MACHINE_CODE, /* elf_machine_code */ | |
486 | ELF_MAXPAGESIZE, /* maxpagesize */ | |
252b5132 RH |
487 | elf_info_to_howto, |
488 | elf_info_to_howto_rel, | |
489 | elf_backend_sym_is_global, | |
490 | elf_backend_object_p, | |
491 | elf_backend_symbol_processing, | |
492 | elf_backend_symbol_table_processing, | |
493 | elf_backend_get_symbol_type, | |
174fd7f9 | 494 | elf_backend_name_local_section_symbols, |
252b5132 RH |
495 | elf_backend_section_processing, |
496 | elf_backend_section_from_shdr, | |
fa152c49 | 497 | elf_backend_section_flags, |
20cfcaae | 498 | elf_backend_section_from_phdr, |
252b5132 RH |
499 | elf_backend_fake_sections, |
500 | elf_backend_section_from_bfd_section, | |
501 | elf_backend_add_symbol_hook, | |
502 | elf_backend_link_output_symbol_hook, | |
503 | elf_backend_create_dynamic_sections, | |
504 | elf_backend_check_relocs, | |
505 | elf_backend_adjust_dynamic_symbol, | |
506 | elf_backend_always_size_sections, | |
507 | elf_backend_size_dynamic_sections, | |
508 | elf_backend_relocate_section, | |
509 | elf_backend_finish_dynamic_symbol, | |
510 | elf_backend_finish_dynamic_sections, | |
511 | elf_backend_begin_write_processing, | |
512 | elf_backend_final_write_processing, | |
513 | elf_backend_additional_program_headers, | |
514 | elf_backend_modify_segment_map, | |
515 | elf_backend_gc_mark_hook, | |
516 | elf_backend_gc_sweep_hook, | |
e6c51ed4 | 517 | elf_backend_post_process_headers, |
587ff49e RH |
518 | elf_backend_print_symbol_all, |
519 | elf_backend_output_arch_syms, | |
c61b8717 RH |
520 | elf_backend_copy_indirect_symbol, |
521 | elf_backend_hide_symbol, | |
9bf7216d | 522 | elf_backend_merge_symbol_attribute, |
9317eacc CM |
523 | elf_backend_emit_relocs, |
524 | elf_backend_count_relocs, | |
bb0082d6 AM |
525 | elf_backend_grok_prstatus, |
526 | elf_backend_grok_psinfo, | |
4e771d61 NC |
527 | elf_backend_sprintf_vma, |
528 | elf_backend_fprintf_vma, | |
db6751f2 | 529 | elf_backend_reloc_type_class, |
73d074b4 DJ |
530 | elf_backend_discard_info, |
531 | elf_backend_ignore_discarded_relocs, | |
ec3391e7 AO |
532 | elf_backend_can_make_relative_eh_frame, |
533 | elf_backend_can_make_lsda_relative_eh_frame, | |
534 | elf_backend_encode_eh_address, | |
73d074b4 | 535 | elf_backend_write_section, |
c6e90b02 TS |
536 | elf_backend_mips_irix_compat, |
537 | elf_backend_mips_rtype_to_howto, | |
252b5132 | 538 | elf_backend_ecoff_debug_swap, |
8d6337fe | 539 | elf_backend_bfd_from_remote_memory, |
4c45e5c9 JJ |
540 | elf_backend_plt_sym_val, |
541 | elf_backend_relplt_name, | |
252b5132 RH |
542 | ELF_MACHINE_ALT1, |
543 | ELF_MACHINE_ALT2, | |
544 | &elf_backend_size_info, | |
2f89ff8d | 545 | elf_backend_special_sections, |
252b5132 RH |
546 | elf_backend_got_symbol_offset, |
547 | elf_backend_got_header_size, | |
86dc0f79 RH |
548 | elf_backend_collect, |
549 | elf_backend_type_change_ok, | |
bf572ba0 MM |
550 | elf_backend_may_use_rel_p, |
551 | elf_backend_may_use_rela_p, | |
552 | elf_backend_default_use_rela_p, | |
b491616a | 553 | elf_backend_rela_normal, |
86dc0f79 | 554 | elf_backend_sign_extend_vma, |
252b5132 RH |
555 | elf_backend_want_got_plt, |
556 | elf_backend_plt_readonly, | |
557 | elf_backend_want_plt_sym, | |
558 | elf_backend_plt_not_loaded, | |
559 | elf_backend_plt_alignment, | |
2ac8ce5f | 560 | elf_backend_can_gc_sections, |
51b64d56 | 561 | elf_backend_can_refcount, |
7fda6dbc | 562 | elf_backend_want_got_sym, |
5e8d7549 NC |
563 | elf_backend_want_dynbss, |
564 | elf_backend_want_p_paddr_set_to_zero | |
252b5132 | 565 | }; |
dd745cfa | 566 | #endif |
252b5132 | 567 | |
c3c89269 NC |
568 | /* Forward declaration for use when initialising alternative_target field. */ |
569 | #ifdef TARGET_LITTLE_SYM | |
570 | extern const bfd_target TARGET_LITTLE_SYM; | |
571 | #endif | |
572 | ||
252b5132 RH |
573 | #ifdef TARGET_BIG_SYM |
574 | const bfd_target TARGET_BIG_SYM = | |
575 | { | |
576 | /* name: identify kind of target */ | |
577 | TARGET_BIG_NAME, | |
578 | ||
579 | /* flavour: general indication about file */ | |
580 | bfd_target_elf_flavour, | |
581 | ||
582 | /* byteorder: data is big endian */ | |
583 | BFD_ENDIAN_BIG, | |
584 | ||
585 | /* header_byteorder: header is also big endian */ | |
586 | BFD_ENDIAN_BIG, | |
587 | ||
588 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
589 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
590 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
591 | |
592 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
593 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
594 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
dbb410c3 | 595 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), |
252b5132 RH |
596 | |
597 | /* leading_symbol_char: is the first char of a user symbol | |
598 | predictable, and if so what is it */ | |
599 | elf_symbol_leading_char, | |
600 | ||
601 | /* ar_pad_char: pad character for filenames within an archive header | |
602 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
603 | of the archiver and/or os and should be independently tunable */ | |
604 | '/', | |
605 | ||
606 | /* ar_max_namelen: maximum number of characters in an archive header | |
607 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
a1aefc76 NC |
608 | of the archiver and should be independently tunable. The System V ABI, |
609 | Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ | |
610 | 15, | |
252b5132 RH |
611 | |
612 | /* Routines to byte-swap various sized integers from the data sections */ | |
613 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
614 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
615 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
616 | ||
617 | /* Routines to byte-swap various sized integers from the file headers */ | |
618 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
619 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
620 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
621 | ||
622 | /* bfd_check_format: check the format of a file being read */ | |
623 | { _bfd_dummy_target, /* unknown format */ | |
624 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
625 | bfd_elfNN_archive_p, /* an archive */ | |
626 | bfd_elfNN_core_file_p /* a core file */ | |
627 | }, | |
628 | ||
629 | /* bfd_set_format: set the format of a file being written */ | |
630 | { bfd_false, | |
631 | bfd_elfNN_mkobject, | |
632 | bfd_elfNN_mkarchive, | |
633 | bfd_elfNN_mkcorefile | |
634 | }, | |
635 | ||
636 | /* bfd_write_contents: write cached information into a file being written */ | |
637 | { bfd_false, | |
638 | bfd_elfNN_write_object_contents, | |
639 | bfd_elfNN_write_archive_contents, | |
640 | bfd_elfNN_write_corefile_contents, | |
641 | }, | |
642 | ||
e656e369 AM |
643 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), |
644 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
645 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
252b5132 | 646 | #ifdef bfd_elfNN_archive_functions |
e656e369 | 647 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), |
252b5132 | 648 | #else |
e656e369 | 649 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), |
252b5132 | 650 | #endif |
e656e369 AM |
651 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), |
652 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
653 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
654 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
655 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
252b5132 | 656 | |
c3c89269 NC |
657 | /* Alternative endian target. */ |
658 | #ifdef TARGET_LITTLE_SYM | |
659 | & TARGET_LITTLE_SYM, | |
660 | #else | |
661 | NULL, | |
662 | #endif | |
663 | ||
252b5132 | 664 | /* backend_data: */ |
9c5bfbb7 | 665 | &elfNN_bed |
252b5132 RH |
666 | }; |
667 | #endif | |
668 | ||
669 | #ifdef TARGET_LITTLE_SYM | |
670 | const bfd_target TARGET_LITTLE_SYM = | |
671 | { | |
672 | /* name: identify kind of target */ | |
673 | TARGET_LITTLE_NAME, | |
674 | ||
675 | /* flavour: general indication about file */ | |
676 | bfd_target_elf_flavour, | |
677 | ||
678 | /* byteorder: data is little endian */ | |
679 | BFD_ENDIAN_LITTLE, | |
680 | ||
681 | /* header_byteorder: header is also little endian */ | |
682 | BFD_ENDIAN_LITTLE, | |
683 | ||
684 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
685 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
686 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
687 | |
688 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
689 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
690 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
dbb410c3 | 691 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP), |
252b5132 RH |
692 | |
693 | /* leading_symbol_char: is the first char of a user symbol | |
694 | predictable, and if so what is it */ | |
695 | elf_symbol_leading_char, | |
696 | ||
697 | /* ar_pad_char: pad character for filenames within an archive header | |
698 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
699 | of the archiver and/or os and should be independently tunable */ | |
700 | '/', | |
701 | ||
702 | /* ar_max_namelen: maximum number of characters in an archive header | |
703 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
a1aefc76 NC |
704 | of the archiver and should be independently tunable. The System V ABI, |
705 | Chapter 7 (Formats & Protocols), Archive section sets this as 15. */ | |
706 | 15, | |
252b5132 RH |
707 | |
708 | /* Routines to byte-swap various sized integers from the data sections */ | |
709 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
710 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
711 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
712 | ||
713 | /* Routines to byte-swap various sized integers from the file headers */ | |
714 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
715 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
716 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
717 | ||
718 | /* bfd_check_format: check the format of a file being read */ | |
719 | { _bfd_dummy_target, /* unknown format */ | |
720 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
721 | bfd_elfNN_archive_p, /* an archive */ | |
722 | bfd_elfNN_core_file_p /* a core file */ | |
723 | }, | |
724 | ||
725 | /* bfd_set_format: set the format of a file being written */ | |
726 | { bfd_false, | |
727 | bfd_elfNN_mkobject, | |
728 | bfd_elfNN_mkarchive, | |
729 | bfd_elfNN_mkcorefile | |
730 | }, | |
731 | ||
732 | /* bfd_write_contents: write cached information into a file being written */ | |
733 | { bfd_false, | |
734 | bfd_elfNN_write_object_contents, | |
735 | bfd_elfNN_write_archive_contents, | |
736 | bfd_elfNN_write_corefile_contents, | |
737 | }, | |
738 | ||
e656e369 AM |
739 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), |
740 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
741 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
252b5132 | 742 | #ifdef bfd_elfNN_archive_functions |
e656e369 | 743 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), |
252b5132 | 744 | #else |
e656e369 | 745 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), |
252b5132 | 746 | #endif |
e656e369 AM |
747 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), |
748 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
749 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
750 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
751 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
252b5132 | 752 | |
c3c89269 NC |
753 | /* Alternative endian target. */ |
754 | #ifdef TARGET_BIG_SYM | |
755 | & TARGET_BIG_SYM, | |
756 | #else | |
757 | NULL, | |
758 | #endif | |
3e932841 | 759 | |
252b5132 | 760 | /* backend_data: */ |
9c5bfbb7 | 761 | &elfNN_bed |
252b5132 RH |
762 | }; |
763 | #endif |