1 /* Target definitions for NN-bit ELF
2 Copyright (C) 1993-2020 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_group_name
196 #define bfd_elfNN_bfd_group_name bfd_elf_group_name
199 #ifndef bfd_elfNN_bfd_discard_group
200 #define bfd_elfNN_bfd_discard_group bfd_generic_discard_group
203 #ifndef bfd_elfNN_section_already_linked
204 #define bfd_elfNN_section_already_linked \
205 _bfd_elf_section_already_linked
208 #ifndef bfd_elfNN_bfd_define_common_symbol
209 #define bfd_elfNN_bfd_define_common_symbol bfd_generic_define_common_symbol
212 #ifndef bfd_elfNN_bfd_link_hide_symbol
213 #define bfd_elfNN_bfd_link_hide_symbol _bfd_elf_link_hide_symbol
216 #ifndef bfd_elfNN_bfd_lookup_section_flags
217 #define bfd_elfNN_bfd_lookup_section_flags bfd_elf_lookup_section_flags
220 #ifndef bfd_elfNN_bfd_make_debug_symbol
221 #define bfd_elfNN_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
224 #ifndef bfd_elfNN_bfd_copy_private_symbol_data
225 #define bfd_elfNN_bfd_copy_private_symbol_data \
226 _bfd_elf_copy_private_symbol_data
229 #ifndef bfd_elfNN_bfd_copy_private_section_data
230 #define bfd_elfNN_bfd_copy_private_section_data \
231 _bfd_elf_copy_private_section_data
233 #ifndef bfd_elfNN_bfd_copy_private_header_data
234 #define bfd_elfNN_bfd_copy_private_header_data \
235 _bfd_elf_copy_private_header_data
237 #ifndef bfd_elfNN_bfd_copy_private_bfd_data
238 #define bfd_elfNN_bfd_copy_private_bfd_data \
239 _bfd_elf_copy_private_bfd_data
241 #ifndef bfd_elfNN_bfd_print_private_bfd_data
242 #define bfd_elfNN_bfd_print_private_bfd_data \
243 _bfd_elf_print_private_bfd_data
245 #ifndef bfd_elfNN_bfd_merge_private_bfd_data
246 #define bfd_elfNN_bfd_merge_private_bfd_data _bfd_bool_bfd_link_true
248 #ifndef bfd_elfNN_bfd_set_private_flags
249 #define bfd_elfNN_bfd_set_private_flags _bfd_bool_bfd_uint_true
251 #ifndef bfd_elfNN_bfd_is_local_label_name
252 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
254 #ifndef bfd_elfNN_bfd_is_target_special_symbol
255 #define bfd_elfNN_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
258 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
259 #define bfd_elfNN_get_dynamic_reloc_upper_bound \
260 _bfd_elf_get_dynamic_reloc_upper_bound
262 #ifndef bfd_elfNN_canonicalize_dynamic_reloc
263 #define bfd_elfNN_canonicalize_dynamic_reloc \
264 _bfd_elf_canonicalize_dynamic_reloc
267 #ifdef elf_backend_relocate_section
268 #ifndef bfd_elfNN_bfd_link_hash_table_create
269 #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
271 #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
272 #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
273 _bfd_elf_copy_link_hash_symbol_type
275 #ifndef bfd_elfNN_bfd_link_add_symbols
276 #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols
278 #ifndef bfd_elfNN_bfd_define_start_stop
279 #define bfd_elfNN_bfd_define_start_stop bfd_elf_define_start_stop
281 #ifndef bfd_elfNN_bfd_final_link
282 #define bfd_elfNN_bfd_final_link bfd_elf_final_link
284 #else /* ! defined (elf_backend_relocate_section) */
285 /* If no backend relocate_section routine, use the generic linker.
286 Note - this will prevent the port from being able to use some of
287 the other features of the ELF linker, because the generic hash structure
288 does not have the fields needed by the ELF linker. In particular it
289 means that linking directly to S-records will not work. */
290 #ifndef bfd_elfNN_bfd_link_hash_table_create
291 #define bfd_elfNN_bfd_link_hash_table_create \
292 _bfd_generic_link_hash_table_create
294 #ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
295 #define bfd_elfNN_bfd_copy_link_hash_symbol_type \
296 _bfd_generic_copy_link_hash_symbol_type
298 #ifndef bfd_elfNN_bfd_link_add_symbols
299 #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
301 #ifndef bfd_elfNN_bfd_define_start_stop
302 #define bfd_elfNN_bfd_define_start_stop bfd_generic_define_start_stop
304 #ifndef bfd_elfNN_bfd_final_link
305 #define bfd_elfNN_bfd_final_link _bfd_generic_final_link
307 #endif /* ! defined (elf_backend_relocate_section) */
309 #ifndef bfd_elfNN_bfd_link_just_syms
310 #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms
313 #ifndef bfd_elfNN_bfd_link_split_section
314 #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
317 #ifndef bfd_elfNN_bfd_link_check_relocs
318 #define bfd_elfNN_bfd_link_check_relocs _bfd_elf_link_check_relocs
321 #ifndef bfd_elfNN_archive_p
322 #define bfd_elfNN_archive_p bfd_generic_archive_p
325 #ifndef bfd_elfNN_write_archive_contents
326 #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents
329 #ifndef bfd_elfNN_mkobject
330 #define bfd_elfNN_mkobject bfd_elf_make_object
333 #ifndef bfd_elfNN_mkcorefile
334 #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
337 #ifndef bfd_elfNN_mkarchive
338 #define bfd_elfNN_mkarchive _bfd_generic_mkarchive
341 #ifndef bfd_elfNN_print_symbol
342 #define bfd_elfNN_print_symbol bfd_elf_print_symbol
345 #ifndef elf_symbol_leading_char
346 #define elf_symbol_leading_char 0
349 #ifndef elf_info_to_howto
350 #define elf_info_to_howto NULL
353 #ifndef elf_info_to_howto_rel
354 #define elf_info_to_howto_rel NULL
357 #ifndef elf_backend_arch_data
358 #define elf_backend_arch_data NULL
361 #ifndef ELF_TARGET_ID
362 #define ELF_TARGET_ID GENERIC_ELF_DATA
365 #ifndef ELF_TARGET_OS
366 #define ELF_TARGET_OS is_normal
370 #define ELF_OSABI ELFOSABI_NONE
373 #ifndef ELF_MAXPAGESIZE
374 # error ELF_MAXPAGESIZE is not defined
375 #define ELF_MAXPAGESIZE 1
378 #ifndef ELF_COMMONPAGESIZE
379 #define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
382 #ifndef ELF_RELROPAGESIZE
383 #define ELF_RELROPAGESIZE ELF_COMMONPAGESIZE
386 #ifndef ELF_MINPAGESIZE
387 #define ELF_MINPAGESIZE ELF_COMMONPAGESIZE
390 #if ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
391 # error ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
393 #if ELF_RELROPAGESIZE > ELF_MAXPAGESIZE
394 # error ELF_RELROPAGESIZE > ELF_MAXPAGESIZE
396 #if ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
397 # error ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
399 #if ELF_MINPAGESIZE > ELF_RELROPAGESIZE
400 # error ELF_MINPAGESIZE > ELF_RELROPAGESIZE
403 #ifndef ELF_DYNAMIC_SEC_FLAGS
404 /* Note that we set the SEC_IN_MEMORY flag for these sections. */
405 #define ELF_DYNAMIC_SEC_FLAGS \
406 (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS \
407 | SEC_IN_MEMORY | SEC_LINKER_CREATED)
410 #ifndef elf_backend_collect
411 #define elf_backend_collect FALSE
413 #ifndef elf_backend_type_change_ok
414 #define elf_backend_type_change_ok FALSE
417 #ifndef elf_backend_sym_is_global
418 #define elf_backend_sym_is_global 0
420 #ifndef elf_backend_object_p
421 #define elf_backend_object_p 0
423 #ifndef elf_backend_symbol_processing
424 #define elf_backend_symbol_processing 0
426 #ifndef elf_backend_symbol_table_processing
427 #define elf_backend_symbol_table_processing 0
429 #ifndef elf_backend_get_symbol_type
430 #define elf_backend_get_symbol_type 0
432 #ifndef elf_backend_archive_symbol_lookup
433 #define elf_backend_archive_symbol_lookup _bfd_elf_archive_symbol_lookup
435 #ifndef elf_backend_name_local_section_symbols
436 #define elf_backend_name_local_section_symbols 0
438 #ifndef elf_backend_section_processing
439 #define elf_backend_section_processing 0
441 #ifndef elf_backend_section_from_shdr
442 #define elf_backend_section_from_shdr _bfd_elf_make_section_from_shdr
444 #ifndef elf_backend_section_flags
445 #define elf_backend_section_flags 0
447 #ifndef elf_backend_get_sec_type_attr
448 #define elf_backend_get_sec_type_attr _bfd_elf_get_sec_type_attr
450 #ifndef elf_backend_section_from_phdr
451 #define elf_backend_section_from_phdr _bfd_elf_make_section_from_phdr
453 #ifndef elf_backend_fake_sections
454 #define elf_backend_fake_sections 0
456 #ifndef elf_backend_section_from_bfd_section
457 #define elf_backend_section_from_bfd_section 0
459 #ifndef elf_backend_add_symbol_hook
460 #define elf_backend_add_symbol_hook 0
462 #ifndef elf_backend_link_output_symbol_hook
463 #define elf_backend_link_output_symbol_hook 0
465 #ifndef elf_backend_create_dynamic_sections
466 #define elf_backend_create_dynamic_sections 0
468 #ifndef elf_backend_omit_section_dynsym
469 #define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_default
471 #ifndef elf_backend_relocs_compatible
472 #define elf_backend_relocs_compatible _bfd_elf_default_relocs_compatible
474 #ifndef elf_backend_check_relocs
475 #define elf_backend_check_relocs 0
477 #ifndef elf_backend_check_directives
478 #define elf_backend_check_directives 0
480 #ifndef elf_backend_notice_as_needed
481 #define elf_backend_notice_as_needed _bfd_elf_notice_as_needed
483 #ifndef elf_backend_adjust_dynamic_symbol
484 #define elf_backend_adjust_dynamic_symbol 0
486 #ifndef elf_backend_always_size_sections
487 #define elf_backend_always_size_sections 0
489 #ifndef elf_backend_size_dynamic_sections
490 #define elf_backend_size_dynamic_sections 0
492 #ifndef elf_backend_strip_zero_sized_dynamic_sections
493 #define elf_backend_strip_zero_sized_dynamic_sections 0
495 #ifndef elf_backend_init_index_section
496 #define elf_backend_init_index_section _bfd_void_bfd_link
498 #ifndef elf_backend_relocate_section
499 #define elf_backend_relocate_section 0
501 #ifndef elf_backend_finish_dynamic_symbol
502 #define elf_backend_finish_dynamic_symbol 0
504 #ifndef elf_backend_finish_dynamic_sections
505 #define elf_backend_finish_dynamic_sections 0
507 #ifndef elf_backend_begin_write_processing
508 #define elf_backend_begin_write_processing 0
510 #ifndef elf_backend_final_write_processing
511 #define elf_backend_final_write_processing _bfd_elf_final_write_processing
513 #ifndef elf_backend_additional_program_headers
514 #define elf_backend_additional_program_headers 0
516 #ifndef elf_backend_modify_segment_map
517 #define elf_backend_modify_segment_map 0
519 #ifndef elf_backend_modify_headers
520 #define elf_backend_modify_headers _bfd_elf_modify_headers
522 #ifndef elf_backend_allow_non_load_phdr
523 #define elf_backend_allow_non_load_phdr 0
525 #ifndef elf_backend_ecoff_debug_swap
526 #define elf_backend_ecoff_debug_swap 0
528 #ifndef elf_backend_bfd_from_remote_memory
529 #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory
531 #ifndef elf_backend_core_find_build_id
532 #define elf_backend_core_find_build_id _bfd_elfNN_core_find_build_id
534 #ifndef elf_backend_got_header_size
535 #define elf_backend_got_header_size 0
537 #ifndef elf_backend_got_elt_size
538 #define elf_backend_got_elt_size _bfd_elf_default_got_elt_size
540 #ifndef elf_backend_obj_attrs_vendor
541 #define elf_backend_obj_attrs_vendor NULL
543 #ifndef elf_backend_obj_attrs_section
544 #define elf_backend_obj_attrs_section NULL
546 #ifndef elf_backend_obj_attrs_arg_type
547 #define elf_backend_obj_attrs_arg_type NULL
549 #ifndef elf_backend_obj_attrs_section_type
550 #define elf_backend_obj_attrs_section_type SHT_GNU_ATTRIBUTES
552 #ifndef elf_backend_obj_attrs_order
553 #define elf_backend_obj_attrs_order NULL
555 #ifndef elf_backend_obj_attrs_handle_unknown
556 #define elf_backend_obj_attrs_handle_unknown NULL
558 #ifndef elf_backend_parse_gnu_properties
559 #define elf_backend_parse_gnu_properties NULL
561 #ifndef elf_backend_merge_gnu_properties
562 #define elf_backend_merge_gnu_properties NULL
564 #ifndef elf_backend_setup_gnu_properties
565 #define elf_backend_setup_gnu_properties _bfd_elf_link_setup_gnu_properties
567 #ifndef elf_backend_fixup_gnu_properties
568 #define elf_backend_fixup_gnu_properties NULL
570 #ifndef elf_backend_static_tls_alignment
571 #define elf_backend_static_tls_alignment 1
573 #ifndef elf_backend_init_file_header
574 #define elf_backend_init_file_header _bfd_elf_init_file_header
576 #ifndef elf_backend_print_symbol_all
577 #define elf_backend_print_symbol_all NULL
579 #ifndef elf_backend_output_arch_local_syms
580 #define elf_backend_output_arch_local_syms NULL
582 #ifndef elf_backend_output_arch_syms
583 #define elf_backend_output_arch_syms NULL
585 #ifndef elf_backend_filter_implib_symbols
586 #define elf_backend_filter_implib_symbols NULL
588 #ifndef elf_backend_copy_indirect_symbol
589 #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
591 #ifndef elf_backend_hide_symbol
592 #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
594 #ifndef elf_backend_fixup_symbol
595 #define elf_backend_fixup_symbol NULL
597 #ifndef elf_backend_merge_symbol_attribute
598 #define elf_backend_merge_symbol_attribute NULL
600 #ifndef elf_backend_get_target_dtag
601 #define elf_backend_get_target_dtag NULL
603 #ifndef elf_backend_ignore_undef_symbol
604 #define elf_backend_ignore_undef_symbol NULL
606 #ifndef elf_backend_emit_relocs
607 #define elf_backend_emit_relocs _bfd_elf_link_output_relocs
609 #ifndef elf_backend_update_relocs
610 #define elf_backend_update_relocs NULL
612 #ifndef elf_backend_count_relocs
613 #define elf_backend_count_relocs NULL
615 #ifndef elf_backend_count_additional_relocs
616 #define elf_backend_count_additional_relocs NULL
618 #ifndef elf_backend_sort_relocs_p
619 #define elf_backend_sort_relocs_p NULL
621 #ifndef elf_backend_grok_prstatus
622 #define elf_backend_grok_prstatus NULL
624 #ifndef elf_backend_grok_psinfo
625 #define elf_backend_grok_psinfo NULL
627 #ifndef elf_backend_grok_freebsd_prstatus
628 #define elf_backend_grok_freebsd_prstatus NULL
630 #ifndef elf_backend_write_core_note
631 #define elf_backend_write_core_note NULL
633 #ifndef elf_backend_lookup_section_flags_hook
634 #define elf_backend_lookup_section_flags_hook NULL
636 #ifndef elf_backend_reloc_type_class
637 #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class
639 #ifndef elf_backend_discard_info
640 #define elf_backend_discard_info NULL
642 #ifndef elf_backend_ignore_discarded_relocs
643 #define elf_backend_ignore_discarded_relocs NULL
645 #ifndef elf_backend_action_discarded
646 #define elf_backend_action_discarded _bfd_elf_default_action_discarded
648 #ifndef elf_backend_eh_frame_address_size
649 #define elf_backend_eh_frame_address_size _bfd_elf_eh_frame_address_size
651 #ifndef elf_backend_can_make_relative_eh_frame
652 #define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative
654 #ifndef elf_backend_can_make_lsda_relative_eh_frame
655 #define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative
657 #ifndef elf_backend_encode_eh_address
658 #define elf_backend_encode_eh_address _bfd_elf_encode_eh_address
660 #ifndef elf_backend_write_section
661 #define elf_backend_write_section NULL
663 #ifndef elf_backend_mips_irix_compat
664 #define elf_backend_mips_irix_compat NULL
666 #ifndef elf_backend_mips_rtype_to_howto
667 #define elf_backend_mips_rtype_to_howto NULL
670 /* Previously, backends could only use SHT_REL or SHT_RELA relocation
671 sections, but not both. They defined USE_REL to indicate SHT_REL
672 sections, and left it undefined to indicated SHT_RELA sections.
673 For backwards compatibility, we still support this usage. */
678 /* Use these in new code. */
679 #ifndef elf_backend_may_use_rel_p
680 #define elf_backend_may_use_rel_p USE_REL
682 #ifndef elf_backend_may_use_rela_p
683 #define elf_backend_may_use_rela_p !USE_REL
685 #ifndef elf_backend_default_use_rela_p
686 #define elf_backend_default_use_rela_p !USE_REL
688 #ifndef elf_backend_rela_plts_and_copies_p
689 #define elf_backend_rela_plts_and_copies_p elf_backend_default_use_rela_p
692 #ifndef elf_backend_rela_normal
693 #define elf_backend_rela_normal 0
696 #ifndef elf_backend_dtrel_excludes_plt
697 #define elf_backend_dtrel_excludes_plt 0
700 #ifndef elf_backend_plt_sym_val
701 #define elf_backend_plt_sym_val NULL
703 #ifndef elf_backend_relplt_name
704 #define elf_backend_relplt_name NULL
707 #ifndef ELF_MACHINE_ALT1
708 #define ELF_MACHINE_ALT1 0
711 #ifndef ELF_MACHINE_ALT2
712 #define ELF_MACHINE_ALT2 0
715 #ifndef elf_backend_size_info
716 #define elf_backend_size_info _bfd_elfNN_size_info
719 #ifndef elf_backend_special_sections
720 #define elf_backend_special_sections NULL
723 #ifndef elf_backend_sign_extend_vma
724 #define elf_backend_sign_extend_vma 0
727 #ifndef elf_backend_link_order_error_handler
728 #define elf_backend_link_order_error_handler _bfd_error_handler
731 #ifndef elf_backend_common_definition
732 #define elf_backend_common_definition _bfd_elf_common_definition
735 #ifndef elf_backend_common_section_index
736 #define elf_backend_common_section_index _bfd_elf_common_section_index
739 #ifndef elf_backend_common_section
740 #define elf_backend_common_section _bfd_elf_common_section
743 #ifndef elf_backend_merge_symbol
744 #define elf_backend_merge_symbol NULL
747 #ifndef elf_backend_hash_symbol
748 #define elf_backend_hash_symbol _bfd_elf_hash_symbol
751 #ifndef elf_backend_record_xhash_symbol
752 #define elf_backend_record_xhash_symbol NULL
755 #ifndef elf_backend_is_function_type
756 #define elf_backend_is_function_type _bfd_elf_is_function_type
759 #ifndef elf_backend_maybe_function_sym
760 #define elf_backend_maybe_function_sym _bfd_elf_maybe_function_sym
763 #ifndef elf_backend_get_reloc_section
764 #define elf_backend_get_reloc_section _bfd_elf_plt_get_reloc_section
767 #ifndef elf_backend_copy_special_section_fields
768 #define elf_backend_copy_special_section_fields _bfd_elf_copy_special_section_fields
771 #ifndef elf_backend_compact_eh_encoding
772 #define elf_backend_compact_eh_encoding NULL
775 #ifndef elf_backend_cant_unwind_opcode
776 #define elf_backend_cant_unwind_opcode NULL
779 #ifndef elf_backend_init_secondary_reloc_section
780 #define elf_backend_init_secondary_reloc_section _bfd_elf_init_secondary_reloc_section
783 #ifndef elf_backend_slurp_secondary_reloc_section
784 #define elf_backend_slurp_secondary_reloc_section _bfd_elf_slurp_secondary_reloc_section
787 #ifndef elf_backend_write_secondary_reloc_section
788 #define elf_backend_write_secondary_reloc_section _bfd_elf_write_secondary_reloc_section
791 #ifndef elf_backend_symbol_section_index
792 #define elf_backend_symbol_section_index NULL
795 #ifndef elf_match_priority
796 #define elf_match_priority \
797 (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0)
800 extern const struct elf_size_info _bfd_elfNN_size_info
;
802 static struct elf_backend_data elfNN_bed
=
805 ELF_TARGET_ID
, /* target_id */
806 ELF_TARGET_OS
, /* target_os */
807 ELF_MACHINE_CODE
, /* elf_machine_code */
808 ELF_OSABI
, /* elf_osabi */
809 ELF_MAXPAGESIZE
, /* maxpagesize */
810 ELF_MINPAGESIZE
, /* minpagesize */
811 ELF_COMMONPAGESIZE
, /* commonpagesize */
812 ELF_RELROPAGESIZE
, /* commonpagesize to use with -z relro */
813 ELF_DYNAMIC_SEC_FLAGS
, /* dynamic_sec_flags */
814 elf_backend_arch_data
,
816 elf_info_to_howto_rel
,
817 elf_backend_sym_is_global
,
818 elf_backend_object_p
,
819 elf_backend_symbol_processing
,
820 elf_backend_symbol_table_processing
,
821 elf_backend_get_symbol_type
,
822 elf_backend_archive_symbol_lookup
,
823 elf_backend_name_local_section_symbols
,
824 elf_backend_section_processing
,
825 elf_backend_section_from_shdr
,
826 elf_backend_section_flags
,
827 elf_backend_get_sec_type_attr
,
828 elf_backend_section_from_phdr
,
829 elf_backend_fake_sections
,
830 elf_backend_section_from_bfd_section
,
831 elf_backend_add_symbol_hook
,
832 elf_backend_link_output_symbol_hook
,
833 elf_backend_create_dynamic_sections
,
834 elf_backend_omit_section_dynsym
,
835 elf_backend_relocs_compatible
,
836 elf_backend_check_relocs
,
837 elf_backend_check_directives
,
838 elf_backend_notice_as_needed
,
839 elf_backend_adjust_dynamic_symbol
,
840 elf_backend_always_size_sections
,
841 elf_backend_size_dynamic_sections
,
842 elf_backend_strip_zero_sized_dynamic_sections
,
843 elf_backend_init_index_section
,
844 elf_backend_relocate_section
,
845 elf_backend_finish_dynamic_symbol
,
846 elf_backend_finish_dynamic_sections
,
847 elf_backend_begin_write_processing
,
848 elf_backend_final_write_processing
,
849 elf_backend_additional_program_headers
,
850 elf_backend_modify_segment_map
,
851 elf_backend_modify_headers
,
852 elf_backend_allow_non_load_phdr
,
854 elf_backend_gc_mark_dynamic_ref
,
855 elf_backend_gc_mark_hook
,
856 elf_backend_gc_mark_extra_sections
,
857 elf_backend_init_file_header
,
858 elf_backend_print_symbol_all
,
859 elf_backend_output_arch_local_syms
,
860 elf_backend_output_arch_syms
,
861 elf_backend_filter_implib_symbols
,
862 elf_backend_copy_indirect_symbol
,
863 elf_backend_hide_symbol
,
864 elf_backend_fixup_symbol
,
865 elf_backend_merge_symbol_attribute
,
866 elf_backend_get_target_dtag
,
867 elf_backend_ignore_undef_symbol
,
868 elf_backend_emit_relocs
,
869 elf_backend_update_relocs
,
870 elf_backend_count_relocs
,
871 elf_backend_count_additional_relocs
,
872 elf_backend_sort_relocs_p
,
873 elf_backend_grok_prstatus
,
874 elf_backend_grok_psinfo
,
875 elf_backend_grok_freebsd_prstatus
,
876 elf_backend_write_core_note
,
877 elf_backend_lookup_section_flags_hook
,
878 elf_backend_reloc_type_class
,
879 elf_backend_discard_info
,
880 elf_backend_ignore_discarded_relocs
,
881 elf_backend_action_discarded
,
882 elf_backend_eh_frame_address_size
,
883 elf_backend_can_make_relative_eh_frame
,
884 elf_backend_can_make_lsda_relative_eh_frame
,
885 elf_backend_encode_eh_address
,
886 elf_backend_write_section
,
887 elf_backend_mips_irix_compat
,
888 elf_backend_mips_rtype_to_howto
,
889 elf_backend_ecoff_debug_swap
,
890 elf_backend_bfd_from_remote_memory
,
891 elf_backend_core_find_build_id
,
892 elf_backend_plt_sym_val
,
893 elf_backend_common_definition
,
894 elf_backend_common_section_index
,
895 elf_backend_common_section
,
896 elf_backend_merge_symbol
,
897 elf_backend_hash_symbol
,
898 elf_backend_record_xhash_symbol
,
899 elf_backend_is_function_type
,
900 elf_backend_maybe_function_sym
,
901 elf_backend_get_reloc_section
,
902 elf_backend_copy_special_section_fields
,
903 elf_backend_link_order_error_handler
,
904 elf_backend_relplt_name
,
907 &elf_backend_size_info
,
908 elf_backend_special_sections
,
909 elf_backend_got_header_size
,
910 elf_backend_got_elt_size
,
911 elf_backend_obj_attrs_vendor
,
912 elf_backend_obj_attrs_section
,
913 elf_backend_obj_attrs_arg_type
,
914 elf_backend_obj_attrs_section_type
,
915 elf_backend_obj_attrs_order
,
916 elf_backend_obj_attrs_handle_unknown
,
917 elf_backend_parse_gnu_properties
,
918 elf_backend_merge_gnu_properties
,
919 elf_backend_setup_gnu_properties
,
920 elf_backend_fixup_gnu_properties
,
921 elf_backend_compact_eh_encoding
,
922 elf_backend_cant_unwind_opcode
,
923 elf_backend_symbol_section_index
,
924 elf_backend_init_secondary_reloc_section
,
925 elf_backend_slurp_secondary_reloc_section
,
926 elf_backend_write_secondary_reloc_section
,
927 elf_backend_static_tls_alignment
,
928 elf_backend_stack_align
,
929 elf_backend_strtab_flags
,
931 elf_backend_type_change_ok
,
932 elf_backend_may_use_rel_p
,
933 elf_backend_may_use_rela_p
,
934 elf_backend_default_use_rela_p
,
935 elf_backend_rela_plts_and_copies_p
,
936 elf_backend_rela_normal
,
937 elf_backend_dtrel_excludes_plt
,
938 elf_backend_sign_extend_vma
,
939 elf_backend_want_got_plt
,
940 elf_backend_plt_readonly
,
941 elf_backend_want_plt_sym
,
942 elf_backend_plt_not_loaded
,
943 elf_backend_plt_alignment
,
944 elf_backend_can_gc_sections
,
945 elf_backend_can_refcount
,
946 elf_backend_want_got_sym
,
947 elf_backend_want_dynbss
,
948 elf_backend_want_dynrelro
,
949 elf_backend_want_p_paddr_set_to_zero
,
950 elf_backend_no_page_alias
,
951 elf_backend_default_execstack
,
952 elf_backend_caches_rawsize
,
953 elf_backend_extern_protected_data
,
954 elf_backend_always_renumber_dynsyms
,
955 elf_backend_linux_prpsinfo32_ugid16
,
956 elf_backend_linux_prpsinfo64_ugid16
959 /* Forward declaration for use when initialising alternative_target field. */
960 #ifdef TARGET_LITTLE_SYM
961 extern const bfd_target TARGET_LITTLE_SYM
;
964 #ifdef TARGET_BIG_SYM
965 const bfd_target TARGET_BIG_SYM
=
967 /* name: identify kind of target */
970 /* flavour: general indication about file */
971 bfd_target_elf_flavour
,
973 /* byteorder: data is big endian */
976 /* header_byteorder: header is also big endian */
979 /* object_flags: mask of all file flags */
980 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
981 | DYNAMIC
| WP_TEXT
| D_PAGED
| BFD_COMPRESS
| BFD_DECOMPRESS
982 | BFD_COMPRESS_GABI
| BFD_CONVERT_ELF_COMMON
| BFD_USE_ELF_STT_COMMON
),
984 /* section_flags: mask of all section flags */
985 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
986 | SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
| SEC_EXCLUDE
| SEC_SORT_ENTRIES
987 | SEC_SMALL_DATA
| SEC_MERGE
| SEC_STRINGS
| SEC_GROUP
),
989 /* leading_symbol_char: is the first char of a user symbol
990 predictable, and if so what is it */
991 elf_symbol_leading_char
,
993 /* ar_pad_char: pad character for filenames within an archive header
994 FIXME: this really has nothing to do with ELF, this is a characteristic
995 of the archiver and/or os and should be independently tunable */
998 /* ar_max_namelen: maximum number of characters in an archive header
999 FIXME: this really has nothing to do with ELF, this is a characteristic
1000 of the archiver and should be independently tunable. The System V ABI,
1001 Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
1006 /* Routines to byte-swap various sized integers from the data sections */
1007 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
1008 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
1009 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
1011 /* Routines to byte-swap various sized integers from the file headers */
1012 bfd_getb64
, bfd_getb_signed_64
, bfd_putb64
,
1013 bfd_getb32
, bfd_getb_signed_32
, bfd_putb32
,
1014 bfd_getb16
, bfd_getb_signed_16
, bfd_putb16
,
1016 /* bfd_check_format: check the format of a file being read */
1017 { _bfd_dummy_target
, /* unknown format */
1018 bfd_elfNN_object_p
, /* assembler/linker output (object file) */
1019 bfd_elfNN_archive_p
, /* an archive */
1020 bfd_elfNN_core_file_p
/* a core file */
1023 /* bfd_set_format: set the format of a file being written */
1024 { _bfd_bool_bfd_false_error
,
1026 bfd_elfNN_mkarchive
,
1027 bfd_elfNN_mkcorefile
1030 /* bfd_write_contents: write cached information into a file being written */
1031 { _bfd_bool_bfd_false_error
,
1032 bfd_elfNN_write_object_contents
,
1033 bfd_elfNN_write_archive_contents
,
1034 bfd_elfNN_write_corefile_contents
,
1037 BFD_JUMP_TABLE_GENERIC (bfd_elfNN
),
1038 BFD_JUMP_TABLE_COPY (bfd_elfNN
),
1039 BFD_JUMP_TABLE_CORE (bfd_elfNN
),
1040 #ifdef bfd_elfNN_archive_functions
1041 BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive
),
1042 #elif defined USE_64_BIT_ARCHIVE
1043 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit
),
1045 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
1047 BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN
),
1048 BFD_JUMP_TABLE_RELOCS (bfd_elfNN
),
1049 BFD_JUMP_TABLE_WRITE (bfd_elfNN
),
1050 BFD_JUMP_TABLE_LINK (bfd_elfNN
),
1051 BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN
),
1053 /* Alternative endian target. */
1054 #ifdef TARGET_LITTLE_SYM
1055 & TARGET_LITTLE_SYM
,
1065 #ifdef TARGET_LITTLE_SYM
1066 const bfd_target TARGET_LITTLE_SYM
=
1068 /* name: identify kind of target */
1071 /* flavour: general indication about file */
1072 bfd_target_elf_flavour
,
1074 /* byteorder: data is little endian */
1077 /* header_byteorder: header is also little endian */
1080 /* object_flags: mask of all file flags */
1081 (HAS_RELOC
| EXEC_P
| HAS_LINENO
| HAS_DEBUG
| HAS_SYMS
| HAS_LOCALS
1082 | DYNAMIC
| WP_TEXT
| D_PAGED
| BFD_COMPRESS
| BFD_DECOMPRESS
1083 | BFD_COMPRESS_GABI
| BFD_CONVERT_ELF_COMMON
| BFD_USE_ELF_STT_COMMON
),
1085 /* section_flags: mask of all section flags */
1086 (SEC_HAS_CONTENTS
| SEC_ALLOC
| SEC_LOAD
| SEC_RELOC
| SEC_READONLY
1087 | SEC_CODE
| SEC_DATA
| SEC_DEBUGGING
| SEC_EXCLUDE
| SEC_SORT_ENTRIES
1088 | SEC_SMALL_DATA
| SEC_MERGE
| SEC_STRINGS
| SEC_GROUP
),
1090 /* leading_symbol_char: is the first char of a user symbol
1091 predictable, and if so what is it */
1092 elf_symbol_leading_char
,
1094 /* ar_pad_char: pad character for filenames within an archive header
1095 FIXME: this really has nothing to do with ELF, this is a characteristic
1096 of the archiver and/or os and should be independently tunable */
1099 /* ar_max_namelen: maximum number of characters in an archive header
1100 FIXME: this really has nothing to do with ELF, this is a characteristic
1101 of the archiver and should be independently tunable. The System V ABI,
1102 Chapter 7 (Formats & Protocols), Archive section sets this as 15. */
1107 /* Routines to byte-swap various sized integers from the data sections */
1108 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1109 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1110 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
1112 /* Routines to byte-swap various sized integers from the file headers */
1113 bfd_getl64
, bfd_getl_signed_64
, bfd_putl64
,
1114 bfd_getl32
, bfd_getl_signed_32
, bfd_putl32
,
1115 bfd_getl16
, bfd_getl_signed_16
, bfd_putl16
,
1117 /* bfd_check_format: check the format of a file being read */
1118 { _bfd_dummy_target
, /* unknown format */
1119 bfd_elfNN_object_p
, /* assembler/linker output (object file) */
1120 bfd_elfNN_archive_p
, /* an archive */
1121 bfd_elfNN_core_file_p
/* a core file */
1124 /* bfd_set_format: set the format of a file being written */
1125 { _bfd_bool_bfd_false_error
,
1127 bfd_elfNN_mkarchive
,
1128 bfd_elfNN_mkcorefile
1131 /* bfd_write_contents: write cached information into a file being written */
1132 { _bfd_bool_bfd_false_error
,
1133 bfd_elfNN_write_object_contents
,
1134 bfd_elfNN_write_archive_contents
,
1135 bfd_elfNN_write_corefile_contents
,
1138 BFD_JUMP_TABLE_GENERIC (bfd_elfNN
),
1139 BFD_JUMP_TABLE_COPY (bfd_elfNN
),
1140 BFD_JUMP_TABLE_CORE (bfd_elfNN
),
1141 #ifdef bfd_elfNN_archive_functions
1142 BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive
),
1143 #elif defined USE_64_BIT_ARCHIVE
1144 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit
),
1146 BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff
),
1148 BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN
),
1149 BFD_JUMP_TABLE_RELOCS (bfd_elfNN
),
1150 BFD_JUMP_TABLE_WRITE (bfd_elfNN
),
1151 BFD_JUMP_TABLE_LINK (bfd_elfNN
),
1152 BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN
),
1154 /* Alternative endian target. */
1155 #ifdef TARGET_BIG_SYM