1 /* Target definitions for NN-bit ELF
2 Copyright (C) 1993-2018 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 /* This structure contains everything that BFD knows about a target.
23 It includes things like its byte order, name, what routines to call
24 to do various operations, etc. Every BFD points to a target structure
25 with its "xvec" member.
27 There are two such structures here: one for big-endian machines and
28 one for little-endian machines. */
30 #ifndef bfd_elfNN_close_and_cleanup
31 #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup
33 #ifndef bfd_elfNN_bfd_free_cached_info
34 #define bfd_elfNN_bfd_free_cached_info _bfd_free_cached_info
36 #ifndef bfd_elfNN_get_section_contents
37 #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents
40 #define bfd_elfNN_canonicalize_dynamic_symtab \
41 _bfd_elf_canonicalize_dynamic_symtab
42 #ifndef bfd_elfNN_get_synthetic_symtab
43 #define bfd_elfNN_get_synthetic_symtab \
44 _bfd_elf_get_synthetic_symtab
46 #ifndef bfd_elfNN_canonicalize_reloc
47 #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc
49 #ifndef bfd_elfNN_set_reloc
50 #define bfd_elfNN_set_reloc _bfd_generic_set_reloc
52 #ifndef bfd_elfNN_find_nearest_line
53 #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line
55 #ifndef bfd_elfNN_find_line
56 #define bfd_elfNN_find_line _bfd_elf_find_line
58 #ifndef bfd_elfNN_find_inliner_info
59 #define bfd_elfNN_find_inliner_info _bfd_elf_find_inliner_info
61 #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols
62 #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol
63 #define bfd_elfNN_get_dynamic_symtab_upper_bound \
64 _bfd_elf_get_dynamic_symtab_upper_bound
65 #define bfd_elfNN_get_lineno _bfd_elf_get_lineno
66 #ifndef bfd_elfNN_get_reloc_upper_bound
67 #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound
69 #ifndef bfd_elfNN_get_symbol_info
70 #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info
72 #ifndef bfd_elfNN_get_symbol_version_string
73 #define bfd_elfNN_get_symbol_version_string \
74 _bfd_elf_get_symbol_version_string
76 #define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab
77 #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound
78 #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol
79 #ifndef bfd_elfNN_new_section_hook
80 #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook
82 #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach
83 #ifndef bfd_elfNN_set_section_contents
84 #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents
86 #define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers
87 #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
88 #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
90 #define bfd_elfNN_get_section_contents_in_window \
91 _bfd_generic_get_section_contents_in_window
93 #ifndef elf_backend_can_refcount
94 #define elf_backend_can_refcount 0
96 #ifndef elf_backend_want_got_plt
97 #define elf_backend_want_got_plt 0
99 #ifndef elf_backend_plt_readonly
100 #define elf_backend_plt_readonly 0
102 #ifndef elf_backend_want_plt_sym
103 #define elf_backend_want_plt_sym 0
105 #ifndef elf_backend_plt_not_loaded
106 #define elf_backend_plt_not_loaded 0
108 #ifndef elf_backend_plt_alignment
109 #define elf_backend_plt_alignment 2
111 #ifndef elf_backend_want_dynbss
112 #define elf_backend_want_dynbss 1
114 #ifndef elf_backend_want_dynrelro
115 #define elf_backend_want_dynrelro 0
117 #ifndef elf_backend_want_p_paddr_set_to_zero
118 #define elf_backend_want_p_paddr_set_to_zero 0
120 #ifndef elf_backend_no_page_alias
121 #define elf_backend_no_page_alias 0
123 #ifndef elf_backend_default_execstack
124 #define elf_backend_default_execstack 1
126 #ifndef elf_backend_caches_rawsize
127 #define elf_backend_caches_rawsize 0
129 #ifndef elf_backend_extern_protected_data
130 #define elf_backend_extern_protected_data 0
132 #ifndef elf_backend_always_renumber_dynsyms
133 #define elf_backend_always_renumber_dynsyms FALSE
135 #ifndef elf_backend_linux_prpsinfo32_ugid16
136 #define elf_backend_linux_prpsinfo32_ugid16 FALSE
138 #ifndef elf_backend_linux_prpsinfo64_ugid16
139 #define elf_backend_linux_prpsinfo64_ugid16 FALSE
141 #ifndef elf_backend_stack_align
142 #define elf_backend_stack_align 16
144 #ifndef elf_backend_strtab_flags
145 #define elf_backend_strtab_flags 0
148 #define bfd_elfNN_bfd_debug_info_start _bfd_void_bfd
149 #define bfd_elfNN_bfd_debug_info_end _bfd_void_bfd
150 #define bfd_elfNN_bfd_debug_info_accumulate _bfd_void_bfd_asection
152 #ifndef bfd_elfNN_bfd_get_relocated_section_contents
153 #define bfd_elfNN_bfd_get_relocated_section_contents \
154 bfd_generic_get_relocated_section_contents
157 #ifndef bfd_elfNN_bfd_relax_section
158 #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section
161 #ifndef elf_backend_can_gc_sections
162 #define elf_backend_can_gc_sections 0
164 #ifndef elf_backend_can_refcount
165 #define elf_backend_can_refcount 0
167 #ifndef elf_backend_want_got_sym
168 #define elf_backend_want_got_sym 1
170 #ifndef elf_backend_gc_keep
171 #define elf_backend_gc_keep _bfd_elf_gc_keep
173 #ifndef elf_backend_gc_mark_dynamic_ref
174 #define elf_backend_gc_mark_dynamic_ref bfd_elf_gc_mark_dynamic_ref_symbol
176 #ifndef elf_backend_gc_mark_hook
177 #define elf_backend_gc_mark_hook _bfd_elf_gc_mark_hook
179 #ifndef elf_backend_gc_mark_extra_sections
180 #define elf_backend_gc_mark_extra_sections _bfd_elf_gc_mark_extra_sections
182 #ifndef bfd_elfNN_bfd_gc_sections
183 #define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections
186 #ifndef bfd_elfNN_bfd_merge_sections
187 #define bfd_elfNN_bfd_merge_sections \
188 _bfd_elf_merge_sections
191 #ifndef bfd_elfNN_bfd_is_group_section
192 #define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section
195 #ifndef bfd_elfNN_bfd_discard_group
196 #define bfd_elfNN_bfd_discard_group bfd_generic_discard_group
199 #ifndef bfd_elfNN_section_already_linked
200 #define bfd_elfNN_section_already_linked \
201 _bfd_elf_section_already_linked
204 #ifndef bfd_elfNN_bfd_define_common_symbol
205 #define bfd_elfNN_bfd_define_common_symbol bfd_generic_define_common_symbol
208 #ifndef bfd_elfNN_bfd_lookup_section_flags
209 #define bfd_elfNN_bfd_lookup_section_flags bfd_elf_lookup_section_flags
212 #ifndef bfd_elfNN_bfd_make_debug_symbol
213 #define bfd_elfNN_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
216 #ifndef bfd_elfNN_bfd_copy_private_symbol_data
217 #define bfd_elfNN_bfd_copy_private_symbol_data \
218 _bfd_elf_copy_private_symbol_data
221 #ifndef bfd_elfNN_bfd_copy_private_section_data
222 #define bfd_elfNN_bfd_copy_private_section_data \
223 _bfd_elf_copy_private_section_data
225 #ifndef bfd_elfNN_bfd_copy_private_header_data
226 #define bfd_elfNN_bfd_copy_private_header_data \
227 _bfd_elf_copy_private_header_data
229 #ifndef bfd_elfNN_bfd_copy_private_bfd_data
230 #define bfd_elfNN_bfd_copy_private_bfd_data \
231 _bfd_elf_copy_private_bfd_data
233 #ifndef bfd_elfNN_bfd_print_private_bfd_data
234 #define bfd_elfNN_bfd_print_private_bfd_data \
235 _bfd_elf_print_private_bfd_data
237 #ifndef bfd_elfNN_bfd_merge_private_bfd_data
238 #define bfd_elfNN_bfd_merge_private_bfd_data _bfd_bool_bfd_link_true
240 #ifndef bfd_elfNN_bfd_set_private_flags
241 #define bfd_elfNN_bfd_set_private_flags _bfd_bool_bfd_uint_true
243 #ifndef bfd_elfNN_bfd_is_local_label_name
244 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
246 #ifndef bfd_elfNN_bfd_is_target_special_symbol
247 #define bfd_elfNN_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
250 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
251 #define bfd_elfNN_get_dynamic_reloc_upper_bound \
252 _bfd_elf_get_dynamic_reloc_upper_bound
254 #ifndef bfd_elfNN_canonicalize_dynamic_reloc
255 #define bfd_elfNN_canonicalize_dynamic_reloc \
256 _bfd_elf_canonicalize_dynamic_reloc
259 #ifdef elf_backend_relocate_section
260 #ifndef bfd_elfNN_bfd_link_hash_table_create
261 #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
263 #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
264 #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
265 _bfd_elf_copy_link_hash_symbol_type
267 #ifndef bfd_elfNN_bfd_link_add_symbols
268 #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols
270 #ifndef bfd_elfNN_bfd_define_start_stop
271 #define bfd_elfNN_bfd_define_start_stop bfd_elf_define_start_stop
273 #ifndef bfd_elfNN_bfd_final_link
274 #define bfd_elfNN_bfd_final_link bfd_elf_final_link
276 #else /* ! defined (elf_backend_relocate_section) */
277 /* If no backend relocate_section routine, use the generic linker.
278 Note - this will prevent the port from being able to use some of
279 the other features of the ELF linker, because the generic hash structure
280 does not have the fields needed by the ELF linker. In particular it
281 means that linking directly to S-records will not work. */
282 #ifndef bfd_elfNN_bfd_link_hash_table_create
283 #define bfd_elfNN_bfd_link_hash_table_create \
284 _bfd_generic_link_hash_table_create
286 #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
287 #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
288 _bfd_generic_copy_link_hash_symbol_type
290 #ifndef bfd_elfNN_bfd_link_add_symbols
291 #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
293 #ifndef bfd_elfNN_bfd_define_start_stop
294 #define bfd_elfNN_bfd_define_start_stop bfd_generic_define_start_stop
296 #ifndef bfd_elfNN_bfd_final_link
297 #define bfd_elfNN_bfd_final_link _bfd_generic_final_link
299 #endif /* ! defined (elf_backend_relocate_section) */
301 #ifndef bfd_elfNN_bfd_link_just_syms
302 #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms
305 #ifndef bfd_elfNN_bfd_link_split_section
306 #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
309 #ifndef bfd_elfNN_bfd_link_check_relocs
310 #define bfd_elfNN_bfd_link_check_relocs _bfd_elf_link_check_relocs
313 #ifndef bfd_elfNN_archive_p
314 #define bfd_elfNN_archive_p bfd_generic_archive_p
317 #ifndef bfd_elfNN_write_archive_contents
318 #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents
321 #ifndef bfd_elfNN_mkobject
322 #define bfd_elfNN_mkobject bfd_elf_make_object
325 #ifndef bfd_elfNN_mkcorefile
326 #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
329 #ifndef bfd_elfNN_mkarchive
330 #define bfd_elfNN_mkarchive _bfd_generic_mkarchive
333 #ifndef bfd_elfNN_print_symbol
334 #define bfd_elfNN_print_symbol bfd_elf_print_symbol
337 #ifndef elf_symbol_leading_char
338 #define elf_symbol_leading_char 0
341 #ifndef elf_info_to_howto
342 #define elf_info_to_howto 0
345 #ifndef elf_info_to_howto_rel
346 #define elf_info_to_howto_rel 0
349 #ifndef elf_backend_arch_data
350 #define elf_backend_arch_data NULL
353 #ifndef ELF_TARGET_ID
354 #define ELF_TARGET_ID GENERIC_ELF_DATA
358 #define ELF_OSABI ELFOSABI_NONE
361 #ifndef ELF_MAXPAGESIZE
362 # error ELF_MAXPAGESIZE is not defined
363 #define ELF_MAXPAGESIZE 1
366 #ifndef ELF_COMMONPAGESIZE
367 #define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
370 #ifndef ELF_MINPAGESIZE
371 #define ELF_MINPAGESIZE ELF_COMMONPAGESIZE
374 #if ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
375 # error ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
377 #if ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
378 # error ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
381 #ifndef ELF_DYNAMIC_SEC_FLAGS
382 /* Note that we set the SEC_IN_MEMORY flag for these sections. */
383 #define ELF_DYNAMIC_SEC_FLAGS \
384 (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS \
385 | SEC_IN_MEMORY | SEC_LINKER_CREATED)
388 #ifndef elf_backend_collect
389 #define elf_backend_collect FALSE
391 #ifndef elf_backend_type_change_ok
392 #define elf_backend_type_change_ok FALSE
395 #ifndef elf_backend_sym_is_global
396 #define elf_backend_sym_is_global 0
398 #ifndef elf_backend_object_p
399 #define elf_backend_object_p 0
401 #ifndef elf_backend_symbol_processing
402 #define elf_backend_symbol_processing 0
404 #ifndef elf_backend_symbol_table_processing
405 #define elf_backend_symbol_table_processing 0
407 #ifndef elf_backend_get_symbol_type
408 #define elf_backend_get_symbol_type 0
410 #ifndef elf_backend_archive_symbol_lookup
411 #define elf_backend_archive_symbol_lookup _bfd_elf_archive_symbol_lookup
413 #ifndef elf_backend_name_local_section_symbols
414 #define elf_backend_name_local_section_symbols 0
416 #ifndef elf_backend_section_processing
417 #define elf_backend_section_processing 0
419 #ifndef elf_backend_section_from_shdr
420 #define elf_backend_section_from_shdr _bfd_elf_make_section_from_shdr
422 #ifndef elf_backend_section_flags
423 #define elf_backend_section_flags 0
425 #ifndef elf_backend_get_sec_type_attr
426 #define elf_backend_get_sec_type_attr _bfd_elf_get_sec_type_attr
428 #ifndef elf_backend_section_from_phdr
429 #define elf_backend_section_from_phdr _bfd_elf_make_section_from_phdr
431 #ifndef elf_backend_fake_sections
432 #define elf_backend_fake_sections 0
434 #ifndef elf_backend_section_from_bfd_section
435 #define elf_backend_section_from_bfd_section 0
437 #ifndef elf_backend_add_symbol_hook
438 #define elf_backend_add_symbol_hook 0
440 #ifndef elf_backend_link_output_symbol_hook
441 #define elf_backend_link_output_symbol_hook 0
443 #ifndef elf_backend_create_dynamic_sections
444 #define elf_backend_create_dynamic_sections 0
446 #ifndef elf_backend_omit_section_dynsym
447 #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_default
449 #ifndef elf_backend_relocs_compatible
450 #define elf_backend_relocs_compatible _bfd_elf_default_relocs_compatible
452 #ifndef elf_backend_check_relocs
453 #define elf_backend_check_relocs 0
455 #ifndef elf_backend_check_directives
456 #define elf_backend_check_directives 0
458 #ifndef elf_backend_notice_as_needed
459 #define elf_backend_notice_as_needed _bfd_elf_notice_as_needed
461 #ifndef elf_backend_adjust_dynamic_symbol
462 #define elf_backend_adjust_dynamic_symbol 0
464 #ifndef elf_backend_always_size_sections
465 #define elf_backend_always_size_sections 0
467 #ifndef elf_backend_size_dynamic_sections
468 #define elf_backend_size_dynamic_sections 0
470 #ifndef elf_backend_init_index_section
471 #define elf_backend_init_index_section _bfd_void_bfd_link
473 #ifndef elf_backend_relocate_section
474 #define elf_backend_relocate_section 0
476 #ifndef elf_backend_finish_dynamic_symbol
477 #define elf_backend_finish_dynamic_symbol 0
479 #ifndef elf_backend_finish_dynamic_sections
480 #define elf_backend_finish_dynamic_sections 0
482 #ifndef elf_backend_begin_write_processing
483 #define elf_backend_begin_write_processing 0
485 #ifndef elf_backend_final_write_processing
486 #define elf_backend_final_write_processing 0
488 #ifndef elf_backend_additional_program_headers
489 #define elf_backend_additional_program_headers 0
491 #ifndef elf_backend_modify_segment_map
492 #define elf_backend_modify_segment_map 0
494 #ifndef elf_backend_modify_program_headers
495 #define elf_backend_modify_program_headers 0
497 #ifndef elf_backend_allow_non_load_phdr
498 #define elf_backend_allow_non_load_phdr 0
500 #ifndef elf_backend_ecoff_debug_swap
501 #define elf_backend_ecoff_debug_swap 0
503 #ifndef elf_backend_bfd_from_remote_memory
504 #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory
506 #ifndef elf_backend_got_header_size
507 #define elf_backend_got_header_size 0
509 #ifndef elf_backend_got_elt_size
510 #define elf_backend_got_elt_size _bfd_elf_default_got_elt_size
512 #ifndef elf_backend_obj_attrs_vendor
513 #define elf_backend_obj_attrs_vendor NULL
515 #ifndef elf_backend_obj_attrs_section
516 #define elf_backend_obj_attrs_section NULL
518 #ifndef elf_backend_obj_attrs_arg_type
519 #define elf_backend_obj_attrs_arg_type NULL
521 #ifndef elf_backend_obj_attrs_section_type
522 #define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES
524 #ifndef elf_backend_obj_attrs_order
525 #define elf_backend_obj_attrs_order NULL
527 #ifndef elf_backend_obj_attrs_handle_unknown
528 #define elf_backend_obj_attrs_handle_unknown NULL
530 #ifndef elf_backend_parse_gnu_properties
531 #define elf_backend_parse_gnu_properties NULL
533 #ifndef elf_backend_merge_gnu_properties
534 #define elf_backend_merge_gnu_properties NULL
536 #ifndef elf_backend_setup_gnu_properties
537 #define elf_backend_setup_gnu_properties _bfd_elf_link_setup_gnu_properties
539 #ifndef elf_backend_static_tls_alignment
540 #define elf_backend_static_tls_alignment 1
542 #ifndef elf_backend_post_process_headers
543 #define elf_backend_post_process_headers _bfd_elf_post_process_headers
545 #ifndef elf_backend_print_symbol_all
546 #define elf_backend_print_symbol_all NULL
548 #ifndef elf_backend_output_arch_local_syms
549 #define elf_backend_output_arch_local_syms NULL
551 #ifndef elf_backend_output_arch_syms
552 #define elf_backend_output_arch_syms NULL
554 #ifndef elf_backend_filter_implib_symbols
555 #define elf_backend_filter_implib_symbols NULL
557 #ifndef elf_backend_copy_indirect_symbol
558 #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
560 #ifndef elf_backend_hide_symbol
561 #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
563 #ifndef elf_backend_fixup_symbol
564 #define elf_backend_fixup_symbol NULL
566 #ifndef elf_backend_merge_symbol_attribute
567 #define elf_backend_merge_symbol_attribute NULL
569 #ifndef elf_backend_get_target_dtag
570 #define elf_backend_get_target_dtag NULL
572 #ifndef elf_backend_ignore_undef_symbol
573 #define elf_backend_ignore_undef_symbol NULL
575 #ifndef elf_backend_emit_relocs
576 #define elf_backend_emit_relocs _bfd_elf_link_output_relocs
578 #ifndef elf_backend_update_relocs
579 #define elf_backend_update_relocs NULL
581 #ifndef elf_backend_count_relocs
582 #define elf_backend_count_relocs NULL
584 #ifndef elf_backend_count_additional_relocs
585 #define elf_backend_count_additional_relocs NULL
587 #ifndef elf_backend_sort_relocs_p
588 #define elf_backend_sort_relocs_p NULL
590 #ifndef elf_backend_grok_prstatus
591 #define elf_backend_grok_prstatus NULL
593 #ifndef elf_backend_grok_psinfo
594 #define elf_backend_grok_psinfo NULL
596 #ifndef elf_backend_grok_freebsd_prstatus
597 #define elf_backend_grok_freebsd_prstatus NULL
599 #ifndef elf_backend_write_core_note
600 #define elf_backend_write_core_note NULL
602 #ifndef elf_backend_lookup_section_flags_hook
603 #define elf_backend_lookup_section_flags_hook NULL
605 #ifndef elf_backend_reloc_type_class
606 #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class
608 #ifndef elf_backend_discard_info
609 #define elf_backend_discard_info NULL
611 #ifndef elf_backend_ignore_discarded_relocs
612 #define elf_backend_ignore_discarded_relocs NULL
614 #ifndef elf_backend_action_discarded
615 #define elf_backend_action_discarded _bfd_elf_default_action_discarded
617 #ifndef elf_backend_eh_frame_address_size
618 #define elf_backend_eh_frame_address_size _bfd_elf_eh_frame_address_size
620 #ifndef elf_backend_can_make_relative_eh_frame
621 #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative
623 #ifndef elf_backend_can_make_lsda_relative_eh_frame
624 #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative
626 #ifndef elf_backend_encode_eh_address
627 #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address
629 #ifndef elf_backend_write_section
630 #define elf_backend_write_section NULL
632 #ifndef elf_backend_mips_irix_compat
633 #define elf_backend_mips_irix_compat NULL
635 #ifndef elf_backend_mips_rtype_to_howto
636 #define elf_backend_mips_rtype_to_howto NULL
639 /* Previously, backends could only use SHT_REL or SHT_RELA relocation
640 sections, but not both. They defined USE_REL to indicate SHT_REL
641 sections, and left it undefined to indicated SHT_RELA sections.
642 For backwards compatibility, we still support this usage. */
647 /* Use these in new code. */
648 #ifndef elf_backend_may_use_rel_p
649 #define elf_backend_may_use_rel_p USE_REL
651 #ifndef elf_backend_may_use_rela_p
652 #define elf_backend_may_use_rela_p !USE_REL
654 #ifndef elf_backend_default_use_rela_p
655 #define elf_backend_default_use_rela_p !USE_REL
657 #ifndef elf_backend_rela_plts_and_copies_p
658 #define elf_backend_rela_plts_and_copies_p elf_backend_default_use_rela_p
661 #ifndef elf_backend_rela_normal
662 #define elf_backend_rela_normal 0
665 #ifndef elf_backend_dtrel_excludes_plt
666 #define elf_backend_dtrel_excludes_plt 0
669 #ifndef elf_backend_plt_sym_val
670 #define elf_backend_plt_sym_val NULL
672 #ifndef elf_backend_relplt_name
673 #define elf_backend_relplt_name NULL
676 #ifndef ELF_MACHINE_ALT1
677 #define ELF_MACHINE_ALT1 0
680 #ifndef ELF_MACHINE_ALT2
681 #define ELF_MACHINE_ALT2 0
684 #ifndef elf_backend_size_info
685 #define elf_backend_size_info _bfd_elfNN_size_info
688 #ifndef elf_backend_special_sections
689 #define elf_backend_special_sections NULL
692 #ifndef elf_backend_sign_extend_vma
693 #define elf_backend_sign_extend_vma 0
696 #ifndef elf_backend_link_order_error_handler
697 #define elf_backend_link_order_error_handler _bfd_error_handler
700 #ifndef elf_backend_common_definition
701 #define elf_backend_common_definition _bfd_elf_common_definition
704 #ifndef elf_backend_common_section_index
705 #define elf_backend_common_section_index _bfd_elf_common_section_index
708 #ifndef elf_backend_common_section
709 #define elf_backend_common_section _bfd_elf_common_section
712 #ifndef elf_backend_merge_symbol
713 #define elf_backend_merge_symbol NULL
716 #ifndef elf_backend_hash_symbol
717 #define elf_backend_hash_symbol _bfd_elf_hash_symbol
720 #ifndef elf_backend_is_function_type
721 #define elf_backend_is_function_type _bfd_elf_is_function_type
724 #ifndef elf_backend_maybe_function_sym
725 #define elf_backend_maybe_function_sym _bfd_elf_maybe_function_sym
728 #ifndef elf_backend_get_reloc_section
729 #define elf_backend_get_reloc_section _bfd_elf_plt_get_reloc_section
732 #ifndef elf_backend_copy_special_section_fields
733 #define elf_backend_copy_special_section_fields NULL
736 #ifndef elf_backend_compact_eh_encoding
737 #define elf_backend_compact_eh_encoding NULL
740 #ifndef elf_backend_cant_unwind_opcode
741 #define elf_backend_cant_unwind_opcode 0
744 #ifndef elf_match_priority
745 #define elf_match_priority \
746 (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0)
749 extern const struct elf_size_info _bfd_elfNN_size_info
;
751 static struct elf_backend_data elfNN_bed
=
754 ELF_TARGET_ID
, /* target_id */
755 ELF_MACHINE_CODE
, /* elf_machine_code */
756 ELF_OSABI
, /* elf_osabi */
757 ELF_MAXPAGESIZE
, /* maxpagesize */
758 ELF_MINPAGESIZE
, /* minpagesize */
759 ELF_COMMONPAGESIZE
, /* commonpagesize */
760 ELF_DYNAMIC_SEC_FLAGS
, /* dynamic_sec_flags */
761 elf_backend_arch_data
,
763 elf_info_to_howto_rel
,
764 elf_backend_sym_is_global
,
765 elf_backend_object_p
,
766 elf_backend_symbol_processing
,
767 elf_backend_symbol_table_processing
,
768 elf_backend_get_symbol_type
,
769 elf_backend_archive_symbol_lookup
,
770 elf_backend_name_local_section_symbols
,
771 elf_backend_section_processing
,
772 elf_backend_section_from_shdr
,
773 elf_backend_section_flags
,
774 elf_backend_get_sec_type_attr
,
775 elf_backend_section_from_phdr
,
776 elf_backend_fake_sections
,
777 elf_backend_section_from_bfd_section
,
778 elf_backend_add_symbol_hook
,
779 elf_backend_link_output_symbol_hook
,
780 elf_backend_create_dynamic_sections
,
781 elf_backend_omit_section_dynsym
,
782 elf_backend_relocs_compatible
,
783 elf_backend_check_relocs
,
784 elf_backend_check_directives
,
785 elf_backend_notice_as_needed
,
786 elf_backend_adjust_dynamic_symbol
,
787 elf_backend_always_size_sections
,
788 elf_backend_size_dynamic_sections
,
789 elf_backend_init_index_section
,
790 elf_backend_relocate_section
,
791 elf_backend_finish_dynamic_symbol
,
792 elf_backend_finish_dynamic_sections
,
793 elf_backend_begin_write_processing
,
794 elf_backend_final_write_processing
,
795 elf_backend_additional_program_headers
,
796 elf_backend_modify_segment_map
,
797 elf_backend_modify_program_headers
,
798 elf_backend_allow_non_load_phdr
,
800 elf_backend_gc_mark_dynamic_ref
,
801 elf_backend_gc_mark_hook
,
802 elf_backend_gc_mark_extra_sections
,
803 elf_backend_post_process_headers
,
804 elf_backend_print_symbol_all
,
805 elf_backend_output_arch_local_syms
,
806 elf_backend_output_arch_syms
,
807 elf_backend_filter_implib_symbols
,
808 elf_backend_copy_indirect_symbol
,
809 elf_backend_hide_symbol
,
810 elf_backend_fixup_symbol
,
811 elf_backend_merge_symbol_attribute
,
812 elf_backend_get_target_dtag
,
813 elf_backend_ignore_undef_symbol
,
814 elf_backend_emit_relocs
,
815 elf_backend_update_relocs
,
816 elf_backend_count_relocs
,
817 elf_backend_count_additional_relocs
,
818 elf_backend_sort_relocs_p
,
819 elf_backend_grok_prstatus
,
820 elf_backend_grok_psinfo
,
821 elf_backend_grok_freebsd_prstatus
,
822 elf_backend_write_core_note
,
823 elf_backend_lookup_section_flags_hook
,
824 elf_backend_reloc_type_class
,
825 elf_backend_discard_info
,
826 elf_backend_ignore_discarded_relocs
,
827 elf_backend_action_discarded
,
828 elf_backend_eh_frame_address_size
,
829 elf_backend_can_make_relative_eh_frame
,
830 elf_backend_can_make_lsda_relative_eh_frame
,
831 elf_backend_encode_eh_address
,
832 elf_backend_write_section
,
833 elf_backend_mips_irix_compat
,
834 elf_backend_mips_rtype_to_howto
,
835 elf_backend_ecoff_debug_swap
,
836 elf_backend_bfd_from_remote_memory
,
837 elf_backend_plt_sym_val
,
838 elf_backend_common_definition
,
839 elf_backend_common_section_index
,
840 elf_backend_common_section
,
841 elf_backend_merge_symbol
,
842 elf_backend_hash_symbol
,
843 elf_backend_is_function_type
,
844 elf_backend_maybe_function_sym
,
845 elf_backend_get_reloc_section
,
846 elf_backend_copy_special_section_fields
,
847 elf_backend_link_order_error_handler
,
848 elf_backend_relplt_name
,
851 &elf_backend_size_info
,
852 elf_backend_special_sections
,
853 elf_backend_got_header_size
,
854 elf_backend_got_elt_size
,
855 elf_backend_obj_attrs_vendor
,
856 elf_backend_obj_attrs_section
,
857 elf_backend_obj_attrs_arg_type
,
858 elf_backend_obj_attrs_section_type
,
859 elf_backend_obj_attrs_order
,
860 elf_backend_obj_attrs_handle_unknown
,
861 elf_backend_parse_gnu_properties
,
862 elf_backend_merge_gnu_properties
,
863 elf_backend_setup_gnu_properties
,
864 elf_backend_compact_eh_encoding
,
865 elf_backend_cant_unwind_opcode
,
866 elf_backend_static_tls_alignment
,
867 elf_backend_stack_align
,
868 elf_backend_strtab_flags
,
870 elf_backend_type_change_ok
,
871 elf_backend_may_use_rel_p
,
872 elf_backend_may_use_rela_p
,
873 elf_backend_default_use_rela_p
,
874 elf_backend_rela_plts_and_copies_p
,
875 elf_backend_rela_normal
,
876 elf_backend_dtrel_excludes_plt
,
877 elf_backend_sign_extend_vma
,
878 elf_backend_want_got_plt
,
879 elf_backend_plt_readonly
,
880 elf_backend_want_plt_sym
,
881 elf_backend_plt_not_loaded
,
882 elf_backend_plt_alignment
,
883 elf_backend_can_gc_sections
,
884 elf_backend_can_refcount
,
885 elf_backend_want_got_sym
,
886 elf_backend_want_dynbss
,
887 elf_backend_want_dynrelro
,
888 elf_backend_want_p_paddr_set_to_zero
,
889 elf_backend_no_page_alias
,
890 elf_backend_default_execstack
,
891 elf_backend_caches_rawsize
,
892 elf_backend_extern_protected_data
,
893 elf_backend_always_renumber_dynsyms
,
894 elf_backend_linux_prpsinfo32_ugid16
,
895 elf_backend_linux_prpsinfo64_ugid16
898 /* Forward declaration for use when initialising alternative_target field. */
899 #ifdef TARGET_LITTLE_SYM
900 extern const bfd_target TARGET_LITTLE_SYM
;
903 #ifdef TARGET_BIG_SYM
904 const bfd_target TARGET_BIG_SYM
=
906 /* name: identify kind of target */
909 /* flavour: general indication about file */
910 bfd_target_elf_flavour
,
912 /* byteorder: data is big endian */
915 /* header_byteorder: header is also big endian */
918 /* object_flags: mask of all file flags */
919 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
920 | DYNAMIC
| WP_TEXT
| D_PAGED
| BFD_COMPRESS
| BFD_DECOMPRESS
921 | BFD_COMPRESS_GABI
| BFD_CONVERT_ELF_COMMON
| BFD_USE_ELF_STT_COMMON
),
923 /* section_flags: mask of all section flags */
924 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
925 | SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
| SEC_EXCLUDE
| SEC_SORT_ENTRIES
926 | SEC_SMALL_DATA
| SEC_MERGE
| SEC_STRINGS
| SEC_GROUP
),
928 /* leading_symbol_char: is the first char of a user symbol
929 predictable, and if so what is it */
930 elf_symbol_leading_char
,
932 /* ar_pad_char: pad character for filenames within an archive header
933 FIXME: this really has nothing to do with ELF, this is a characteristic
934 of the archiver and/or os and should be independently tunable */
937 /* ar_max_namelen: maximum number of characters in an archive header
938 FIXME: this really has nothing to do with ELF, this is a characteristic
939 of the archiver and should be independently tunable. The System V ABI,
940 Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
945 /* Routines to byte-swap various sized integers from the data sections */
946 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
947 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
948 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
950 /* Routines to byte-swap various sized integers from the file headers */
951 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
952 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
953 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
955 /* bfd_check_format: check the format of a file being read */
956 { _bfd_dummy_target
, /* unknown format */
957 bfd_elfNN_object_p
, /* assembler/linker output (object file) */
958 bfd_elfNN_archive_p
, /* an archive */
959 bfd_elfNN_core_file_p
/* a core file */
962 /* bfd_set_format: set the format of a file being written */
963 { _bfd_bool_bfd_false_error
,
969 /* bfd_write_contents: write cached information into a file being written */
970 { _bfd_bool_bfd_false_error
,
971 bfd_elfNN_write_object_contents
,
972 bfd_elfNN_write_archive_contents
,
973 bfd_elfNN_write_corefile_contents
,
976 BFD_JUMP_TABLE_GENERIC (bfd_elfNN
),
977 BFD_JUMP_TABLE_COPY (bfd_elfNN
),
978 BFD_JUMP_TABLE_CORE (bfd_elfNN
),
979 #ifdef bfd_elfNN_archive_functions
980 BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive
),
981 #elif defined USE_64_BIT_ARCHIVE
982 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit
),
984 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
986 BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN
),
987 BFD_JUMP_TABLE_RELOCS (bfd_elfNN
),
988 BFD_JUMP_TABLE_WRITE (bfd_elfNN
),
989 BFD_JUMP_TABLE_LINK (bfd_elfNN
),
990 BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN
),
992 /* Alternative endian target. */
993 #ifdef TARGET_LITTLE_SYM
1004 #ifdef TARGET_LITTLE_SYM
1005 const bfd_target TARGET_LITTLE_SYM
=
1007 /* name: identify kind of target */
1010 /* flavour: general indication about file */
1011 bfd_target_elf_flavour
,
1013 /* byteorder: data is little endian */
1016 /* header_byteorder: header is also little endian */
1019 /* object_flags: mask of all file flags */
1020 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
1021 | DYNAMIC
| WP_TEXT
| D_PAGED
| BFD_COMPRESS
| BFD_DECOMPRESS
1022 | BFD_COMPRESS_GABI
| BFD_CONVERT_ELF_COMMON
| BFD_USE_ELF_STT_COMMON
),
1024 /* section_flags: mask of all section flags */
1025 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
1026 | SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
| SEC_EXCLUDE
| SEC_SORT_ENTRIES
1027 | SEC_SMALL_DATA
| SEC_MERGE
| SEC_STRINGS
| SEC_GROUP
),
1029 /* leading_symbol_char: is the first char of a user symbol
1030 predictable, and if so what is it */
1031 elf_symbol_leading_char
,
1033 /* ar_pad_char: pad character for filenames within an archive header
1034 FIXME: this really has nothing to do with ELF, this is a characteristic
1035 of the archiver and/or os and should be independently tunable */
1038 /* ar_max_namelen: maximum number of characters in an archive header
1039 FIXME: this really has nothing to do with ELF, this is a characteristic
1040 of the archiver and should be independently tunable. The System V ABI,
1041 Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
1046 /* Routines to byte-swap various sized integers from the data sections */
1047 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1048 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1049 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
1051 /* Routines to byte-swap various sized integers from the file headers */
1052 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1053 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1054 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
1056 /* bfd_check_format: check the format of a file being read */
1057 { _bfd_dummy_target
, /* unknown format */
1058 bfd_elfNN_object_p
, /* assembler/linker output (object file) */
1059 bfd_elfNN_archive_p
, /* an archive */
1060 bfd_elfNN_core_file_p
/* a core file */
1063 /* bfd_set_format: set the format of a file being written */
1064 { _bfd_bool_bfd_false_error
,
1066 bfd_elfNN_mkarchive
,
1067 bfd_elfNN_mkcorefile
1070 /* bfd_write_contents: write cached information into a file being written */
1071 { _bfd_bool_bfd_false_error
,
1072 bfd_elfNN_write_object_contents
,
1073 bfd_elfNN_write_archive_contents
,
1074 bfd_elfNN_write_corefile_contents
,
1077 BFD_JUMP_TABLE_GENERIC (bfd_elfNN
),
1078 BFD_JUMP_TABLE_COPY (bfd_elfNN
),
1079 BFD_JUMP_TABLE_CORE (bfd_elfNN
),
1080 #ifdef bfd_elfNN_archive_functions
1081 BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive
),
1082 #elif defined USE_64_BIT_ARCHIVE
1083 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit
),
1085 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
1087 BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN
),
1088 BFD_JUMP_TABLE_RELOCS (bfd_elfNN
),
1089 BFD_JUMP_TABLE_WRITE (bfd_elfNN
),
1090 BFD_JUMP_TABLE_LINK (bfd_elfNN
),
1091 BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN
),
1093 /* Alternative endian target. */
1094 #ifdef TARGET_BIG_SYM