1 /* Target definitions for NN-bit ELF
2 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 Free Software Foundation, Inc.
6 This file is part of BFD, the Binary File Descriptor library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
24 /* This structure contains everything that BFD knows about a target.
25 It includes things like its byte order, name, what routines to call
26 to do various operations, etc. Every BFD points to a target structure
27 with its "xvec" member.
29 There are two such structures here: one for big-endian machines and
30 one for little-endian machines. */
32 #ifndef bfd_elfNN_close_and_cleanup
33 #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup
35 #ifndef bfd_elfNN_bfd_free_cached_info
36 #define bfd_elfNN_bfd_free_cached_info _bfd_free_cached_info
38 #ifndef bfd_elfNN_get_section_contents
39 #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents
42 #define bfd_elfNN_canonicalize_dynamic_symtab \
43 _bfd_elf_canonicalize_dynamic_symtab
44 #ifndef bfd_elfNN_get_synthetic_symtab
45 #define bfd_elfNN_get_synthetic_symtab \
46 _bfd_elf_get_synthetic_symtab
48 #ifndef bfd_elfNN_canonicalize_reloc
49 #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc
51 #ifndef bfd_elfNN_find_nearest_line
52 #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line
54 #ifndef bfd_elfNN_find_inliner_info
55 #define bfd_elfNN_find_inliner_info _bfd_elf_find_inliner_info
57 #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols
58 #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol
59 #define bfd_elfNN_get_dynamic_symtab_upper_bound \
60 _bfd_elf_get_dynamic_symtab_upper_bound
61 #define bfd_elfNN_get_lineno _bfd_elf_get_lineno
62 #ifndef bfd_elfNN_get_reloc_upper_bound
63 #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound
65 #ifndef bfd_elfNN_get_symbol_info
66 #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info
68 #define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab
69 #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound
70 #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol
71 #ifndef bfd_elfNN_new_section_hook
72 #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook
74 #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach
75 #ifndef bfd_elfNN_set_section_contents
76 #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents
78 #define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers
79 #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
80 #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
82 #define bfd_elfNN_get_section_contents_in_window \
83 _bfd_generic_get_section_contents_in_window
85 #ifndef elf_backend_can_refcount
86 #define elf_backend_can_refcount 0
88 #ifndef elf_backend_want_got_plt
89 #define elf_backend_want_got_plt 0
91 #ifndef elf_backend_plt_readonly
92 #define elf_backend_plt_readonly 0
94 #ifndef elf_backend_want_plt_sym
95 #define elf_backend_want_plt_sym 0
97 #ifndef elf_backend_plt_not_loaded
98 #define elf_backend_plt_not_loaded 0
100 #ifndef elf_backend_plt_alignment
101 #define elf_backend_plt_alignment 2
103 #ifndef elf_backend_want_dynbss
104 #define elf_backend_want_dynbss 1
106 #ifndef elf_backend_want_p_paddr_set_to_zero
107 #define elf_backend_want_p_paddr_set_to_zero 0
109 #ifndef elf_backend_default_execstack
110 #define elf_backend_default_execstack 1
112 #ifndef elf_backend_caches_rawsize
113 #define elf_backend_caches_rawsize 0
115 #ifndef elf_backend_stack_align
116 #define elf_backend_stack_align 16
119 #define bfd_elfNN_bfd_debug_info_start bfd_void
120 #define bfd_elfNN_bfd_debug_info_end bfd_void
121 #define bfd_elfNN_bfd_debug_info_accumulate \
122 ((void (*) (bfd*, struct bfd_section *)) bfd_void)
124 #ifndef bfd_elfNN_bfd_get_relocated_section_contents
125 #define bfd_elfNN_bfd_get_relocated_section_contents \
126 bfd_generic_get_relocated_section_contents
129 #ifndef bfd_elfNN_bfd_relax_section
130 #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section
133 #ifndef elf_backend_can_gc_sections
134 #define elf_backend_can_gc_sections 0
136 #ifndef elf_backend_can_refcount
137 #define elf_backend_can_refcount 0
139 #ifndef elf_backend_want_got_sym
140 #define elf_backend_want_got_sym 1
142 #ifndef elf_backend_gc_keep
143 #define elf_backend_gc_keep _bfd_elf_gc_keep
145 #ifndef elf_backend_gc_mark_dynamic_ref
146 #define elf_backend_gc_mark_dynamic_ref bfd_elf_gc_mark_dynamic_ref_symbol
148 #ifndef elf_backend_gc_mark_hook
149 #define elf_backend_gc_mark_hook _bfd_elf_gc_mark_hook
151 #ifndef elf_backend_gc_mark_extra_sections
152 #define elf_backend_gc_mark_extra_sections _bfd_elf_gc_mark_extra_sections
154 #ifndef elf_backend_gc_sweep_hook
155 #define elf_backend_gc_sweep_hook NULL
157 #ifndef bfd_elfNN_bfd_gc_sections
158 #define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections
161 #ifndef bfd_elfNN_bfd_merge_sections
162 #define bfd_elfNN_bfd_merge_sections \
163 _bfd_elf_merge_sections
166 #ifndef bfd_elfNN_bfd_is_group_section
167 #define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section
170 #ifndef bfd_elfNN_bfd_discard_group
171 #define bfd_elfNN_bfd_discard_group bfd_generic_discard_group
174 #ifndef bfd_elfNN_section_already_linked
175 #define bfd_elfNN_section_already_linked \
176 _bfd_elf_section_already_linked
179 #ifndef bfd_elfNN_bfd_define_common_symbol
180 #define bfd_elfNN_bfd_define_common_symbol bfd_generic_define_common_symbol
183 #ifndef bfd_elfNN_bfd_lookup_section_flags
184 #define bfd_elfNN_bfd_lookup_section_flags bfd_elf_lookup_section_flags
187 #ifndef bfd_elfNN_bfd_make_debug_symbol
188 #define bfd_elfNN_bfd_make_debug_symbol \
189 ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
192 #ifndef bfd_elfNN_bfd_copy_private_symbol_data
193 #define bfd_elfNN_bfd_copy_private_symbol_data \
194 _bfd_elf_copy_private_symbol_data
197 #ifndef bfd_elfNN_bfd_copy_private_section_data
198 #define bfd_elfNN_bfd_copy_private_section_data \
199 _bfd_elf_copy_private_section_data
201 #ifndef bfd_elfNN_bfd_copy_private_header_data
202 #define bfd_elfNN_bfd_copy_private_header_data \
203 _bfd_elf_copy_private_header_data
205 #ifndef bfd_elfNN_bfd_copy_private_bfd_data
206 #define bfd_elfNN_bfd_copy_private_bfd_data \
207 _bfd_elf_copy_private_bfd_data
209 #ifndef bfd_elfNN_bfd_print_private_bfd_data
210 #define bfd_elfNN_bfd_print_private_bfd_data \
211 _bfd_elf_print_private_bfd_data
213 #ifndef bfd_elfNN_bfd_merge_private_bfd_data
214 #define bfd_elfNN_bfd_merge_private_bfd_data \
215 ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
217 #ifndef bfd_elfNN_bfd_set_private_flags
218 #define bfd_elfNN_bfd_set_private_flags \
219 ((bfd_boolean (*) (bfd *, flagword)) bfd_true)
221 #ifndef bfd_elfNN_bfd_is_local_label_name
222 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
224 #ifndef bfd_elfNN_bfd_is_target_special_symbol
225 #define bfd_elfNN_bfd_is_target_special_symbol \
226 ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
229 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
230 #define bfd_elfNN_get_dynamic_reloc_upper_bound \
231 _bfd_elf_get_dynamic_reloc_upper_bound
233 #ifndef bfd_elfNN_canonicalize_dynamic_reloc
234 #define bfd_elfNN_canonicalize_dynamic_reloc \
235 _bfd_elf_canonicalize_dynamic_reloc
238 #ifdef elf_backend_relocate_section
239 #ifndef bfd_elfNN_bfd_link_hash_table_create
240 #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
242 #ifndef bfd_elfNN_bfd_link_hash_table_free
243 #define bfd_elfNN_bfd_link_hash_table_free _bfd_elf_link_hash_table_free
245 #ifndef bfd_elfNN_bfd_link_add_symbols
246 #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols
248 #ifndef bfd_elfNN_bfd_final_link
249 #define bfd_elfNN_bfd_final_link bfd_elf_final_link
251 #else /* ! defined (elf_backend_relocate_section) */
252 /* If no backend relocate_section routine, use the generic linker.
253 Note - this will prevent the port from being able to use some of
254 the other features of the ELF linker, because the generic hash structure
255 does not have the fields needed by the ELF linker. In particular it
256 means that linking directly to S-records will not work. */
257 #ifndef bfd_elfNN_bfd_link_hash_table_create
258 #define bfd_elfNN_bfd_link_hash_table_create \
259 _bfd_generic_link_hash_table_create
261 #ifndef bfd_elfNN_bfd_link_hash_table_free
262 #define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
264 #ifndef bfd_elfNN_bfd_link_add_symbols
265 #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
267 #ifndef bfd_elfNN_bfd_final_link
268 #define bfd_elfNN_bfd_final_link _bfd_generic_final_link
270 #endif /* ! defined (elf_backend_relocate_section) */
272 #ifndef bfd_elfNN_bfd_link_just_syms
273 #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms
276 #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
277 #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
278 _bfd_elf_copy_link_hash_symbol_type
281 #ifndef bfd_elfNN_bfd_link_split_section
282 #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
285 #ifndef bfd_elfNN_archive_p
286 #define bfd_elfNN_archive_p bfd_generic_archive_p
289 #ifndef bfd_elfNN_write_archive_contents
290 #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents
293 #ifndef bfd_elfNN_mkobject
294 #define bfd_elfNN_mkobject bfd_elf_make_object
297 #ifndef bfd_elfNN_mkcorefile
298 #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
301 #ifndef bfd_elfNN_mkarchive
302 #define bfd_elfNN_mkarchive _bfd_generic_mkarchive
305 #ifndef bfd_elfNN_print_symbol
306 #define bfd_elfNN_print_symbol bfd_elf_print_symbol
309 #ifndef elf_symbol_leading_char
310 #define elf_symbol_leading_char 0
313 #ifndef elf_info_to_howto
314 #define elf_info_to_howto 0
317 #ifndef elf_info_to_howto_rel
318 #define elf_info_to_howto_rel 0
321 #ifndef elf_backend_arch_data
322 #define elf_backend_arch_data NULL
325 #ifndef ELF_TARGET_ID
326 #define ELF_TARGET_ID GENERIC_ELF_DATA
330 #define ELF_OSABI ELFOSABI_NONE
333 #ifndef ELF_MAXPAGESIZE
334 # error ELF_MAXPAGESIZE is not defined
335 #define ELF_MAXPAGESIZE 1
338 #ifndef ELF_COMMONPAGESIZE
339 #define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
342 #ifndef ELF_MINPAGESIZE
343 #define ELF_MINPAGESIZE ELF_COMMONPAGESIZE
346 #if ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
347 # error ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
349 #if ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
350 # error ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
353 #ifndef ELF_DYNAMIC_SEC_FLAGS
354 /* Note that we set the SEC_IN_MEMORY flag for these sections. */
355 #define ELF_DYNAMIC_SEC_FLAGS \
356 (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS \
357 | SEC_IN_MEMORY | SEC_LINKER_CREATED)
360 #ifndef elf_backend_collect
361 #define elf_backend_collect FALSE
363 #ifndef elf_backend_type_change_ok
364 #define elf_backend_type_change_ok FALSE
367 #ifndef elf_backend_sym_is_global
368 #define elf_backend_sym_is_global 0
370 #ifndef elf_backend_object_p
371 #define elf_backend_object_p 0
373 #ifndef elf_backend_symbol_processing
374 #define elf_backend_symbol_processing 0
376 #ifndef elf_backend_symbol_table_processing
377 #define elf_backend_symbol_table_processing 0
379 #ifndef elf_backend_get_symbol_type
380 #define elf_backend_get_symbol_type 0
382 #ifndef elf_backend_archive_symbol_lookup
383 #define elf_backend_archive_symbol_lookup _bfd_elf_archive_symbol_lookup
385 #ifndef elf_backend_name_local_section_symbols
386 #define elf_backend_name_local_section_symbols 0
388 #ifndef elf_backend_section_processing
389 #define elf_backend_section_processing 0
391 #ifndef elf_backend_section_from_shdr
392 #define elf_backend_section_from_shdr _bfd_elf_make_section_from_shdr
394 #ifndef elf_backend_section_flags
395 #define elf_backend_section_flags 0
397 #ifndef elf_backend_get_sec_type_attr
398 #define elf_backend_get_sec_type_attr _bfd_elf_get_sec_type_attr
400 #ifndef elf_backend_section_from_phdr
401 #define elf_backend_section_from_phdr _bfd_elf_make_section_from_phdr
403 #ifndef elf_backend_fake_sections
404 #define elf_backend_fake_sections 0
406 #ifndef elf_backend_section_from_bfd_section
407 #define elf_backend_section_from_bfd_section 0
409 #ifndef elf_backend_add_symbol_hook
410 #define elf_backend_add_symbol_hook 0
412 #ifndef elf_backend_link_output_symbol_hook
413 #define elf_backend_link_output_symbol_hook 0
415 #ifndef elf_backend_create_dynamic_sections
416 #define elf_backend_create_dynamic_sections 0
418 #ifndef elf_backend_omit_section_dynsym
419 #define elf_backend_omit_section_dynsym _bfd_elf_link_omit_section_dynsym
421 #ifndef elf_backend_relocs_compatible
422 #define elf_backend_relocs_compatible _bfd_elf_default_relocs_compatible
424 #ifndef elf_backend_check_relocs
425 #define elf_backend_check_relocs 0
427 #ifndef elf_backend_check_directives
428 #define elf_backend_check_directives 0
430 #ifndef elf_backend_notice_as_needed
431 #define elf_backend_notice_as_needed _bfd_elf_notice_as_needed
433 #ifndef elf_backend_adjust_dynamic_symbol
434 #define elf_backend_adjust_dynamic_symbol 0
436 #ifndef elf_backend_always_size_sections
437 #define elf_backend_always_size_sections 0
439 #ifndef elf_backend_size_dynamic_sections
440 #define elf_backend_size_dynamic_sections 0
442 #ifndef elf_backend_init_index_section
443 #define elf_backend_init_index_section \
444 ((void (*) (bfd *, struct bfd_link_info *)) bfd_void)
446 #ifndef elf_backend_relocate_section
447 #define elf_backend_relocate_section 0
449 #ifndef elf_backend_finish_dynamic_symbol
450 #define elf_backend_finish_dynamic_symbol 0
452 #ifndef elf_backend_finish_dynamic_sections
453 #define elf_backend_finish_dynamic_sections 0
455 #ifndef elf_backend_begin_write_processing
456 #define elf_backend_begin_write_processing 0
458 #ifndef elf_backend_final_write_processing
459 #define elf_backend_final_write_processing 0
461 #ifndef elf_backend_additional_program_headers
462 #define elf_backend_additional_program_headers 0
464 #ifndef elf_backend_modify_segment_map
465 #define elf_backend_modify_segment_map 0
467 #ifndef elf_backend_modify_program_headers
468 #define elf_backend_modify_program_headers 0
470 #ifndef elf_backend_ecoff_debug_swap
471 #define elf_backend_ecoff_debug_swap 0
473 #ifndef elf_backend_bfd_from_remote_memory
474 #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory
476 #ifndef elf_backend_got_header_size
477 #define elf_backend_got_header_size 0
479 #ifndef elf_backend_got_elt_size
480 #define elf_backend_got_elt_size _bfd_elf_default_got_elt_size
482 #ifndef elf_backend_obj_attrs_vendor
483 #define elf_backend_obj_attrs_vendor NULL
485 #ifndef elf_backend_obj_attrs_section
486 #define elf_backend_obj_attrs_section NULL
488 #ifndef elf_backend_obj_attrs_arg_type
489 #define elf_backend_obj_attrs_arg_type NULL
491 #ifndef elf_backend_obj_attrs_section_type
492 #define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES
494 #ifndef elf_backend_obj_attrs_order
495 #define elf_backend_obj_attrs_order NULL
497 #ifndef elf_backend_obj_attrs_handle_unknown
498 #define elf_backend_obj_attrs_handle_unknown NULL
500 #ifndef elf_backend_static_tls_alignment
501 #define elf_backend_static_tls_alignment 1
503 #ifndef elf_backend_post_process_headers
504 #define elf_backend_post_process_headers _bfd_elf_post_process_headers
506 #ifndef elf_backend_print_symbol_all
507 #define elf_backend_print_symbol_all NULL
509 #ifndef elf_backend_output_arch_local_syms
510 #define elf_backend_output_arch_local_syms NULL
512 #ifndef elf_backend_output_arch_syms
513 #define elf_backend_output_arch_syms NULL
515 #ifndef elf_backend_copy_indirect_symbol
516 #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
518 #ifndef elf_backend_hide_symbol
519 #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
521 #ifndef elf_backend_fixup_symbol
522 #define elf_backend_fixup_symbol NULL
524 #ifndef elf_backend_merge_symbol_attribute
525 #define elf_backend_merge_symbol_attribute NULL
527 #ifndef elf_backend_get_target_dtag
528 #define elf_backend_get_target_dtag NULL
530 #ifndef elf_backend_ignore_undef_symbol
531 #define elf_backend_ignore_undef_symbol NULL
533 #ifndef elf_backend_emit_relocs
534 #define elf_backend_emit_relocs _bfd_elf_link_output_relocs
536 #ifndef elf_backend_count_relocs
537 #define elf_backend_count_relocs NULL
539 #ifndef elf_backend_grok_prstatus
540 #define elf_backend_grok_prstatus NULL
542 #ifndef elf_backend_grok_psinfo
543 #define elf_backend_grok_psinfo NULL
545 #ifndef elf_backend_write_core_note
546 #define elf_backend_write_core_note NULL
548 #ifndef elf_backend_lookup_section_flags_hook
549 #define elf_backend_lookup_section_flags_hook NULL
551 #ifndef elf_backend_reloc_type_class
552 #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class
554 #ifndef elf_backend_discard_info
555 #define elf_backend_discard_info NULL
557 #ifndef elf_backend_ignore_discarded_relocs
558 #define elf_backend_ignore_discarded_relocs NULL
560 #ifndef elf_backend_action_discarded
561 #define elf_backend_action_discarded _bfd_elf_default_action_discarded
563 #ifndef elf_backend_eh_frame_address_size
564 #define elf_backend_eh_frame_address_size _bfd_elf_eh_frame_address_size
566 #ifndef elf_backend_can_make_relative_eh_frame
567 #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative
569 #ifndef elf_backend_can_make_lsda_relative_eh_frame
570 #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative
572 #ifndef elf_backend_encode_eh_address
573 #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address
575 #ifndef elf_backend_write_section
576 #define elf_backend_write_section NULL
578 #ifndef elf_backend_mips_irix_compat
579 #define elf_backend_mips_irix_compat NULL
581 #ifndef elf_backend_mips_rtype_to_howto
582 #define elf_backend_mips_rtype_to_howto NULL
585 /* Previously, backends could only use SHT_REL or SHT_RELA relocation
586 sections, but not both. They defined USE_REL to indicate SHT_REL
587 sections, and left it undefined to indicated SHT_RELA sections.
588 For backwards compatibility, we still support this usage. */
593 /* Use these in new code. */
594 #ifndef elf_backend_may_use_rel_p
595 #define elf_backend_may_use_rel_p USE_REL
597 #ifndef elf_backend_may_use_rela_p
598 #define elf_backend_may_use_rela_p !USE_REL
600 #ifndef elf_backend_default_use_rela_p
601 #define elf_backend_default_use_rela_p !USE_REL
603 #ifndef elf_backend_rela_plts_and_copies_p
604 #define elf_backend_rela_plts_and_copies_p elf_backend_default_use_rela_p
607 #ifndef elf_backend_rela_normal
608 #define elf_backend_rela_normal 0
611 #ifndef elf_backend_plt_sym_val
612 #define elf_backend_plt_sym_val NULL
614 #ifndef elf_backend_relplt_name
615 #define elf_backend_relplt_name NULL
618 #ifndef ELF_MACHINE_ALT1
619 #define ELF_MACHINE_ALT1 0
622 #ifndef ELF_MACHINE_ALT2
623 #define ELF_MACHINE_ALT2 0
626 #ifndef elf_backend_size_info
627 #define elf_backend_size_info _bfd_elfNN_size_info
630 #ifndef elf_backend_special_sections
631 #define elf_backend_special_sections NULL
634 #ifndef elf_backend_sign_extend_vma
635 #define elf_backend_sign_extend_vma 0
638 #ifndef elf_backend_link_order_error_handler
639 #define elf_backend_link_order_error_handler _bfd_default_error_handler
642 #ifndef elf_backend_common_definition
643 #define elf_backend_common_definition _bfd_elf_common_definition
646 #ifndef elf_backend_common_section_index
647 #define elf_backend_common_section_index _bfd_elf_common_section_index
650 #ifndef elf_backend_common_section
651 #define elf_backend_common_section _bfd_elf_common_section
654 #ifndef elf_backend_merge_symbol
655 #define elf_backend_merge_symbol NULL
658 #ifndef elf_backend_hash_symbol
659 #define elf_backend_hash_symbol _bfd_elf_hash_symbol
662 #ifndef elf_backend_is_function_type
663 #define elf_backend_is_function_type _bfd_elf_is_function_type
666 #ifndef elf_backend_maybe_function_sym
667 #define elf_backend_maybe_function_sym _bfd_elf_maybe_function_sym
670 #ifndef elf_match_priority
671 #define elf_match_priority \
672 (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0)
675 extern const struct elf_size_info _bfd_elfNN_size_info
;
677 static struct elf_backend_data elfNN_bed
=
680 ELF_TARGET_ID
, /* target_id */
681 ELF_MACHINE_CODE
, /* elf_machine_code */
682 ELF_OSABI
, /* elf_osabi */
683 ELF_MAXPAGESIZE
, /* maxpagesize */
684 ELF_MINPAGESIZE
, /* minpagesize */
685 ELF_COMMONPAGESIZE
, /* commonpagesize */
686 ELF_DYNAMIC_SEC_FLAGS
, /* dynamic_sec_flags */
687 elf_backend_arch_data
,
689 elf_info_to_howto_rel
,
690 elf_backend_sym_is_global
,
691 elf_backend_object_p
,
692 elf_backend_symbol_processing
,
693 elf_backend_symbol_table_processing
,
694 elf_backend_get_symbol_type
,
695 elf_backend_archive_symbol_lookup
,
696 elf_backend_name_local_section_symbols
,
697 elf_backend_section_processing
,
698 elf_backend_section_from_shdr
,
699 elf_backend_section_flags
,
700 elf_backend_get_sec_type_attr
,
701 elf_backend_section_from_phdr
,
702 elf_backend_fake_sections
,
703 elf_backend_section_from_bfd_section
,
704 elf_backend_add_symbol_hook
,
705 elf_backend_link_output_symbol_hook
,
706 elf_backend_create_dynamic_sections
,
707 elf_backend_omit_section_dynsym
,
708 elf_backend_relocs_compatible
,
709 elf_backend_check_relocs
,
710 elf_backend_check_directives
,
711 elf_backend_notice_as_needed
,
712 elf_backend_adjust_dynamic_symbol
,
713 elf_backend_always_size_sections
,
714 elf_backend_size_dynamic_sections
,
715 elf_backend_init_index_section
,
716 elf_backend_relocate_section
,
717 elf_backend_finish_dynamic_symbol
,
718 elf_backend_finish_dynamic_sections
,
719 elf_backend_begin_write_processing
,
720 elf_backend_final_write_processing
,
721 elf_backend_additional_program_headers
,
722 elf_backend_modify_segment_map
,
723 elf_backend_modify_program_headers
,
725 elf_backend_gc_mark_dynamic_ref
,
726 elf_backend_gc_mark_hook
,
727 elf_backend_gc_mark_extra_sections
,
728 elf_backend_gc_sweep_hook
,
729 elf_backend_post_process_headers
,
730 elf_backend_print_symbol_all
,
731 elf_backend_output_arch_local_syms
,
732 elf_backend_output_arch_syms
,
733 elf_backend_copy_indirect_symbol
,
734 elf_backend_hide_symbol
,
735 elf_backend_fixup_symbol
,
736 elf_backend_merge_symbol_attribute
,
737 elf_backend_get_target_dtag
,
738 elf_backend_ignore_undef_symbol
,
739 elf_backend_emit_relocs
,
740 elf_backend_count_relocs
,
741 elf_backend_grok_prstatus
,
742 elf_backend_grok_psinfo
,
743 elf_backend_write_core_note
,
744 elf_backend_lookup_section_flags_hook
,
745 elf_backend_reloc_type_class
,
746 elf_backend_discard_info
,
747 elf_backend_ignore_discarded_relocs
,
748 elf_backend_action_discarded
,
749 elf_backend_eh_frame_address_size
,
750 elf_backend_can_make_relative_eh_frame
,
751 elf_backend_can_make_lsda_relative_eh_frame
,
752 elf_backend_encode_eh_address
,
753 elf_backend_write_section
,
754 elf_backend_mips_irix_compat
,
755 elf_backend_mips_rtype_to_howto
,
756 elf_backend_ecoff_debug_swap
,
757 elf_backend_bfd_from_remote_memory
,
758 elf_backend_plt_sym_val
,
759 elf_backend_common_definition
,
760 elf_backend_common_section_index
,
761 elf_backend_common_section
,
762 elf_backend_merge_symbol
,
763 elf_backend_hash_symbol
,
764 elf_backend_is_function_type
,
765 elf_backend_maybe_function_sym
,
766 elf_backend_link_order_error_handler
,
767 elf_backend_relplt_name
,
770 &elf_backend_size_info
,
771 elf_backend_special_sections
,
772 elf_backend_got_header_size
,
773 elf_backend_got_elt_size
,
774 elf_backend_obj_attrs_vendor
,
775 elf_backend_obj_attrs_section
,
776 elf_backend_obj_attrs_arg_type
,
777 elf_backend_obj_attrs_section_type
,
778 elf_backend_obj_attrs_order
,
779 elf_backend_obj_attrs_handle_unknown
,
780 elf_backend_static_tls_alignment
,
781 elf_backend_stack_align
,
783 elf_backend_type_change_ok
,
784 elf_backend_may_use_rel_p
,
785 elf_backend_may_use_rela_p
,
786 elf_backend_default_use_rela_p
,
787 elf_backend_rela_plts_and_copies_p
,
788 elf_backend_rela_normal
,
789 elf_backend_sign_extend_vma
,
790 elf_backend_want_got_plt
,
791 elf_backend_plt_readonly
,
792 elf_backend_want_plt_sym
,
793 elf_backend_plt_not_loaded
,
794 elf_backend_plt_alignment
,
795 elf_backend_can_gc_sections
,
796 elf_backend_can_refcount
,
797 elf_backend_want_got_sym
,
798 elf_backend_want_dynbss
,
799 elf_backend_want_p_paddr_set_to_zero
,
800 elf_backend_default_execstack
,
801 elf_backend_caches_rawsize
804 /* Forward declaration for use when initialising alternative_target field. */
805 #ifdef TARGET_LITTLE_SYM
806 extern const bfd_target TARGET_LITTLE_SYM
;
809 #ifdef TARGET_BIG_SYM
810 const bfd_target TARGET_BIG_SYM
=
812 /* name: identify kind of target */
815 /* flavour: general indication about file */
816 bfd_target_elf_flavour
,
818 /* byteorder: data is big endian */
821 /* header_byteorder: header is also big endian */
824 /* object_flags: mask of all file flags */
825 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
826 | DYNAMIC
| WP_TEXT
| D_PAGED
| BFD_COMPRESS
| BFD_DECOMPRESS
),
828 /* section_flags: mask of all section flags */
829 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
830 | SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
| SEC_EXCLUDE
| SEC_SORT_ENTRIES
831 | SEC_SMALL_DATA
| SEC_MERGE
| SEC_STRINGS
| SEC_GROUP
),
833 /* leading_symbol_char: is the first char of a user symbol
834 predictable, and if so what is it */
835 elf_symbol_leading_char
,
837 /* ar_pad_char: pad character for filenames within an archive header
838 FIXME: this really has nothing to do with ELF, this is a characteristic
839 of the archiver and/or os and should be independently tunable */
842 /* ar_max_namelen: maximum number of characters in an archive header
843 FIXME: this really has nothing to do with ELF, this is a characteristic
844 of the archiver and should be independently tunable. The System V ABI,
845 Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
850 /* Routines to byte-swap various sized integers from the data sections */
851 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
852 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
853 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
855 /* Routines to byte-swap various sized integers from the file headers */
856 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
857 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
858 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
860 /* bfd_check_format: check the format of a file being read */
861 { _bfd_dummy_target
, /* unknown format */
862 bfd_elfNN_object_p
, /* assembler/linker output (object file) */
863 bfd_elfNN_archive_p
, /* an archive */
864 bfd_elfNN_core_file_p
/* a core file */
867 /* bfd_set_format: set the format of a file being written */
874 /* bfd_write_contents: write cached information into a file being written */
876 bfd_elfNN_write_object_contents
,
877 bfd_elfNN_write_archive_contents
,
878 bfd_elfNN_write_corefile_contents
,
881 BFD_JUMP_TABLE_GENERIC (bfd_elfNN
),
882 BFD_JUMP_TABLE_COPY (bfd_elfNN
),
883 BFD_JUMP_TABLE_CORE (bfd_elfNN
),
884 #ifdef bfd_elfNN_archive_functions
885 BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive
),
887 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
889 BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN
),
890 BFD_JUMP_TABLE_RELOCS (bfd_elfNN
),
891 BFD_JUMP_TABLE_WRITE (bfd_elfNN
),
892 BFD_JUMP_TABLE_LINK (bfd_elfNN
),
893 BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN
),
895 /* Alternative endian target. */
896 #ifdef TARGET_LITTLE_SYM
907 #ifdef TARGET_LITTLE_SYM
908 const bfd_target TARGET_LITTLE_SYM
=
910 /* name: identify kind of target */
913 /* flavour: general indication about file */
914 bfd_target_elf_flavour
,
916 /* byteorder: data is little endian */
919 /* header_byteorder: header is also little endian */
922 /* object_flags: mask of all file flags */
923 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
924 | DYNAMIC
| WP_TEXT
| D_PAGED
| BFD_COMPRESS
| BFD_DECOMPRESS
),
926 /* section_flags: mask of all section flags */
927 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
928 | SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
| SEC_EXCLUDE
| SEC_SORT_ENTRIES
929 | SEC_SMALL_DATA
| SEC_MERGE
| SEC_STRINGS
| SEC_GROUP
),
931 /* leading_symbol_char: is the first char of a user symbol
932 predictable, and if so what is it */
933 elf_symbol_leading_char
,
935 /* ar_pad_char: pad character for filenames within an archive header
936 FIXME: this really has nothing to do with ELF, this is a characteristic
937 of the archiver and/or os and should be independently tunable */
940 /* ar_max_namelen: maximum number of characters in an archive header
941 FIXME: this really has nothing to do with ELF, this is a characteristic
942 of the archiver and should be independently tunable. The System V ABI,
943 Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
948 /* Routines to byte-swap various sized integers from the data sections */
949 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
950 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
951 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
953 /* Routines to byte-swap various sized integers from the file headers */
954 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
955 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
956 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
958 /* bfd_check_format: check the format of a file being read */
959 { _bfd_dummy_target
, /* unknown format */
960 bfd_elfNN_object_p
, /* assembler/linker output (object file) */
961 bfd_elfNN_archive_p
, /* an archive */
962 bfd_elfNN_core_file_p
/* a core file */
965 /* bfd_set_format: set the format of a file being written */
972 /* bfd_write_contents: write cached information into a file being written */
974 bfd_elfNN_write_object_contents
,
975 bfd_elfNN_write_archive_contents
,
976 bfd_elfNN_write_corefile_contents
,
979 BFD_JUMP_TABLE_GENERIC (bfd_elfNN
),
980 BFD_JUMP_TABLE_COPY (bfd_elfNN
),
981 BFD_JUMP_TABLE_CORE (bfd_elfNN
),
982 #ifdef bfd_elfNN_archive_functions
983 BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive
),
985 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
987 BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN
),
988 BFD_JUMP_TABLE_RELOCS (bfd_elfNN
),
989 BFD_JUMP_TABLE_WRITE (bfd_elfNN
),
990 BFD_JUMP_TABLE_LINK (bfd_elfNN
),
991 BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN
),
993 /* Alternative endian target. */
994 #ifdef TARGET_BIG_SYM