Back to index

cell-binutils  2.17cvs20070401
elfxx-target.h
Go to the documentation of this file.
00001 /* Target definitions for NN-bit ELF
00002    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
00003    2003, 2004, 2005, 2006 Free Software Foundation, Inc.
00004 
00005    This file is part of BFD, the Binary File Descriptor library.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 /* This structure contains everything that BFD knows about a target.
00022    It includes things like its byte order, name, what routines to call
00023    to do various operations, etc.  Every BFD points to a target structure
00024    with its "xvec" member.
00025 
00026    There are two such structures here:  one for big-endian machines and
00027    one for little-endian machines.   */
00028 
00029 #ifndef bfd_elfNN_close_and_cleanup
00030 #define       bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup
00031 #endif
00032 #ifndef bfd_elfNN_bfd_free_cached_info
00033 #define bfd_elfNN_bfd_free_cached_info _bfd_free_cached_info
00034 #endif
00035 #ifndef bfd_elfNN_get_section_contents
00036 #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents
00037 #endif
00038 
00039 #define bfd_elfNN_canonicalize_dynamic_symtab \
00040   _bfd_elf_canonicalize_dynamic_symtab
00041 #ifndef bfd_elfNN_get_synthetic_symtab
00042 #define bfd_elfNN_get_synthetic_symtab \
00043   _bfd_elf_get_synthetic_symtab
00044 #endif
00045 #ifndef bfd_elfNN_canonicalize_reloc
00046 #define bfd_elfNN_canonicalize_reloc      _bfd_elf_canonicalize_reloc
00047 #endif
00048 #ifndef bfd_elfNN_find_nearest_line
00049 #define bfd_elfNN_find_nearest_line       _bfd_elf_find_nearest_line
00050 #endif
00051 #ifndef bfd_elfNN_find_inliner_info
00052 #define bfd_elfNN_find_inliner_info       _bfd_elf_find_inliner_info
00053 #endif
00054 #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols
00055 #define bfd_elfNN_minisymbol_to_symbol    _bfd_elf_minisymbol_to_symbol
00056 #define bfd_elfNN_get_dynamic_symtab_upper_bound \
00057   _bfd_elf_get_dynamic_symtab_upper_bound
00058 #define bfd_elfNN_get_lineno              _bfd_elf_get_lineno
00059 #ifndef bfd_elfNN_get_reloc_upper_bound
00060 #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound
00061 #endif
00062 #ifndef bfd_elfNN_get_symbol_info
00063 #define bfd_elfNN_get_symbol_info  _bfd_elf_get_symbol_info
00064 #endif
00065 #define bfd_elfNN_canonicalize_symtab     _bfd_elf_canonicalize_symtab
00066 #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound
00067 #define bfd_elfNN_make_empty_symbol       _bfd_elf_make_empty_symbol
00068 #ifndef bfd_elfNN_new_section_hook
00069 #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook
00070 #endif
00071 #define bfd_elfNN_set_arch_mach           _bfd_elf_set_arch_mach
00072 #ifndef bfd_elfNN_set_section_contents
00073 #define bfd_elfNN_set_section_contents    _bfd_elf_set_section_contents
00074 #endif
00075 #define bfd_elfNN_sizeof_headers   _bfd_elf_sizeof_headers
00076 #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
00077 #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
00078 
00079 #define bfd_elfNN_get_section_contents_in_window \
00080   _bfd_generic_get_section_contents_in_window
00081 
00082 #ifndef elf_backend_can_refcount
00083 #define elf_backend_can_refcount 0
00084 #endif
00085 #ifndef elf_backend_want_got_plt
00086 #define elf_backend_want_got_plt 0
00087 #endif
00088 #ifndef elf_backend_plt_readonly
00089 #define elf_backend_plt_readonly 0
00090 #endif
00091 #ifndef elf_backend_want_plt_sym
00092 #define elf_backend_want_plt_sym 0
00093 #endif
00094 #ifndef elf_backend_plt_not_loaded
00095 #define elf_backend_plt_not_loaded 0
00096 #endif
00097 #ifndef elf_backend_plt_alignment
00098 #define elf_backend_plt_alignment 2
00099 #endif
00100 #ifndef elf_backend_want_dynbss
00101 #define elf_backend_want_dynbss 1
00102 #endif
00103 #ifndef elf_backend_want_p_paddr_set_to_zero
00104 #define elf_backend_want_p_paddr_set_to_zero 0
00105 #endif
00106 #ifndef elf_backend_default_execstack
00107 #define elf_backend_default_execstack 1
00108 #endif
00109 
00110 #define bfd_elfNN_bfd_debug_info_start    bfd_void
00111 #define bfd_elfNN_bfd_debug_info_end      bfd_void
00112 #define bfd_elfNN_bfd_debug_info_accumulate \
00113   ((void (*) (bfd*, struct bfd_section *)) bfd_void)
00114 
00115 #ifndef bfd_elfNN_bfd_get_relocated_section_contents
00116 #define bfd_elfNN_bfd_get_relocated_section_contents \
00117   bfd_generic_get_relocated_section_contents
00118 #endif
00119 
00120 #ifndef bfd_elfNN_bfd_relax_section
00121 #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section
00122 #endif
00123 
00124 #ifndef elf_backend_can_gc_sections
00125 #define elf_backend_can_gc_sections 0
00126 #endif
00127 #ifndef elf_backend_can_refcount
00128 #define elf_backend_can_refcount 0
00129 #endif
00130 #ifndef elf_backend_want_got_sym
00131 #define elf_backend_want_got_sym 1
00132 #endif
00133 #ifndef elf_backend_gc_mark_dynamic_ref
00134 #define elf_backend_gc_mark_dynamic_ref   bfd_elf_gc_mark_dynamic_ref_symbol
00135 #endif
00136 #ifndef elf_backend_gc_mark_hook
00137 #define elf_backend_gc_mark_hook   _bfd_elf_gc_mark_hook
00138 #endif
00139 #ifndef elf_backend_gc_mark_extra_sections
00140 #define elf_backend_gc_mark_extra_sections       NULL
00141 #endif
00142 #ifndef elf_backend_gc_sweep_hook
00143 #define elf_backend_gc_sweep_hook  NULL
00144 #endif
00145 #ifndef bfd_elfNN_bfd_gc_sections
00146 #define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections
00147 #endif
00148 
00149 #ifndef bfd_elfNN_bfd_merge_sections
00150 #define bfd_elfNN_bfd_merge_sections \
00151   _bfd_elf_merge_sections
00152 #endif
00153 
00154 #ifndef bfd_elfNN_bfd_is_group_section
00155 #define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section
00156 #endif
00157 
00158 #ifndef bfd_elfNN_bfd_discard_group
00159 #define bfd_elfNN_bfd_discard_group bfd_generic_discard_group
00160 #endif
00161 
00162 #ifndef bfd_elfNN_section_already_linked
00163 #define bfd_elfNN_section_already_linked \
00164   _bfd_elf_section_already_linked
00165 #endif
00166 
00167 #ifndef bfd_elfNN_bfd_make_debug_symbol
00168 #define bfd_elfNN_bfd_make_debug_symbol \
00169   ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
00170 #endif
00171 
00172 #ifndef bfd_elfNN_bfd_copy_private_symbol_data
00173 #define bfd_elfNN_bfd_copy_private_symbol_data \
00174   _bfd_elf_copy_private_symbol_data
00175 #endif
00176 
00177 #ifndef bfd_elfNN_bfd_copy_private_section_data
00178 #define bfd_elfNN_bfd_copy_private_section_data \
00179   _bfd_elf_copy_private_section_data
00180 #endif
00181 #ifndef bfd_elfNN_bfd_copy_private_header_data
00182 #define bfd_elfNN_bfd_copy_private_header_data \
00183   _bfd_elf_copy_private_header_data
00184 #endif
00185 #ifndef bfd_elfNN_bfd_copy_private_bfd_data
00186 #define bfd_elfNN_bfd_copy_private_bfd_data \
00187   _bfd_elf_copy_private_bfd_data
00188 #endif
00189 #ifndef bfd_elfNN_bfd_print_private_bfd_data
00190 #define bfd_elfNN_bfd_print_private_bfd_data \
00191   _bfd_elf_print_private_bfd_data
00192 #endif
00193 #ifndef bfd_elfNN_bfd_merge_private_bfd_data
00194 #define bfd_elfNN_bfd_merge_private_bfd_data \
00195   ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
00196 #endif
00197 #ifndef bfd_elfNN_bfd_set_private_flags
00198 #define bfd_elfNN_bfd_set_private_flags \
00199   ((bfd_boolean (*) (bfd *, flagword)) bfd_true)
00200 #endif
00201 #ifndef bfd_elfNN_bfd_is_local_label_name
00202 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
00203 #endif
00204 #ifndef bfd_elfNN_bfd_is_target_special_symbol
00205 #define bfd_elfNN_bfd_is_target_special_symbol \
00206   ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
00207 #endif
00208 
00209 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
00210 #define bfd_elfNN_get_dynamic_reloc_upper_bound \
00211   _bfd_elf_get_dynamic_reloc_upper_bound
00212 #endif
00213 #ifndef bfd_elfNN_canonicalize_dynamic_reloc
00214 #define bfd_elfNN_canonicalize_dynamic_reloc \
00215   _bfd_elf_canonicalize_dynamic_reloc
00216 #endif
00217 
00218 #ifndef bfd_elfNN_bfd_link_hash_table_free
00219 #define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
00220 #endif
00221 
00222 #ifdef elf_backend_relocate_section
00223 #ifndef bfd_elfNN_bfd_link_hash_table_create
00224 #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
00225 #endif
00226 #ifndef bfd_elfNN_bfd_link_add_symbols
00227 #define bfd_elfNN_bfd_link_add_symbols    bfd_elf_link_add_symbols
00228 #endif
00229 #ifndef bfd_elfNN_bfd_final_link
00230 #define bfd_elfNN_bfd_final_link   bfd_elf_final_link
00231 #endif
00232 #else /* ! defined (elf_backend_relocate_section) */
00233 /* If no backend relocate_section routine, use the generic linker.
00234    Note - this will prevent the port from being able to use some of
00235    the other features of the ELF linker, because the generic hash structure
00236    does not have the fields needed by the ELF linker.  In particular it
00237    means that linking directly to S-records will not work.  */
00238 #ifndef bfd_elfNN_bfd_link_hash_table_create
00239 #define bfd_elfNN_bfd_link_hash_table_create \
00240   _bfd_generic_link_hash_table_create
00241 #endif
00242 #ifndef bfd_elfNN_bfd_link_add_symbols
00243 #define bfd_elfNN_bfd_link_add_symbols    _bfd_generic_link_add_symbols
00244 #endif
00245 #ifndef bfd_elfNN_bfd_final_link
00246 #define bfd_elfNN_bfd_final_link   _bfd_generic_final_link
00247 #endif
00248 #endif /* ! defined (elf_backend_relocate_section) */
00249 
00250 #ifndef bfd_elfNN_bfd_link_just_syms
00251 #define bfd_elfNN_bfd_link_just_syms      _bfd_elf_link_just_syms
00252 #endif
00253 
00254 #ifndef bfd_elfNN_bfd_link_split_section
00255 #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
00256 #endif
00257 
00258 #ifndef bfd_elfNN_archive_p
00259 #define bfd_elfNN_archive_p bfd_generic_archive_p
00260 #endif
00261 
00262 #ifndef bfd_elfNN_write_archive_contents
00263 #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents
00264 #endif
00265 
00266 #ifndef bfd_elfNN_mkobject
00267 #define bfd_elfNN_mkobject bfd_elf_mkobject
00268 #endif
00269 
00270 #ifndef bfd_elfNN_mkcorefile
00271 #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
00272 #endif
00273 
00274 #ifndef bfd_elfNN_mkarchive
00275 #define bfd_elfNN_mkarchive _bfd_generic_mkarchive
00276 #endif
00277 
00278 #ifndef bfd_elfNN_print_symbol
00279 #define bfd_elfNN_print_symbol bfd_elf_print_symbol
00280 #endif
00281 
00282 #ifndef elf_symbol_leading_char
00283 #define elf_symbol_leading_char 0
00284 #endif
00285 
00286 #ifndef elf_info_to_howto
00287 #define elf_info_to_howto 0
00288 #endif
00289 
00290 #ifndef elf_info_to_howto_rel
00291 #define elf_info_to_howto_rel 0
00292 #endif
00293 
00294 #ifndef ELF_OSABI
00295 #define ELF_OSABI ELFOSABI_NONE
00296 #endif
00297 
00298 #ifndef ELF_MAXPAGESIZE
00299   #error ELF_MAXPAGESIZE is not defined
00300 #define ELF_MAXPAGESIZE 1
00301 #endif
00302 
00303 #ifndef ELF_MINPAGESIZE
00304 #define ELF_MINPAGESIZE ELF_MAXPAGESIZE
00305 #endif
00306 
00307 #ifndef ELF_COMMONPAGESIZE
00308 #define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
00309 #endif
00310 
00311 #ifndef ELF_DYNAMIC_SEC_FLAGS
00312 /* Note that we set the SEC_IN_MEMORY flag for these sections.  */
00313 #define ELF_DYNAMIC_SEC_FLAGS                    \
00314   (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS       \
00315    | SEC_IN_MEMORY | SEC_LINKER_CREATED)
00316 #endif
00317 
00318 #ifndef elf_backend_collect
00319 #define elf_backend_collect FALSE
00320 #endif
00321 #ifndef elf_backend_type_change_ok
00322 #define elf_backend_type_change_ok FALSE
00323 #endif
00324 
00325 #ifndef elf_backend_sym_is_global
00326 #define elf_backend_sym_is_global  0
00327 #endif
00328 #ifndef elf_backend_object_p
00329 #define elf_backend_object_p              0
00330 #endif
00331 #ifndef elf_backend_symbol_processing
00332 #define elf_backend_symbol_processing     0
00333 #endif
00334 #ifndef elf_backend_symbol_table_processing
00335 #define elf_backend_symbol_table_processing      0
00336 #endif
00337 #ifndef elf_backend_get_symbol_type
00338 #define elf_backend_get_symbol_type 0
00339 #endif
00340 #ifndef elf_backend_archive_symbol_lookup
00341 #define elf_backend_archive_symbol_lookup _bfd_elf_archive_symbol_lookup
00342 #endif
00343 #ifndef elf_backend_name_local_section_symbols
00344 #define elf_backend_name_local_section_symbols   0
00345 #endif
00346 #ifndef elf_backend_section_processing
00347 #define elf_backend_section_processing    0
00348 #endif
00349 #ifndef elf_backend_section_from_shdr
00350 #define elf_backend_section_from_shdr     _bfd_elf_make_section_from_shdr
00351 #endif
00352 #ifndef elf_backend_section_flags
00353 #define elf_backend_section_flags  0
00354 #endif
00355 #ifndef elf_backend_get_sec_type_attr
00356 #define elf_backend_get_sec_type_attr     _bfd_elf_get_sec_type_attr
00357 #endif
00358 #ifndef elf_backend_section_from_phdr
00359 #define elf_backend_section_from_phdr     _bfd_elf_make_section_from_phdr
00360 #endif
00361 #ifndef elf_backend_fake_sections
00362 #define elf_backend_fake_sections  0
00363 #endif
00364 #ifndef elf_backend_section_from_bfd_section
00365 #define elf_backend_section_from_bfd_section     0
00366 #endif
00367 #ifndef elf_backend_add_symbol_hook
00368 #define elf_backend_add_symbol_hook       0
00369 #endif
00370 #ifndef elf_backend_link_output_symbol_hook
00371 #define elf_backend_link_output_symbol_hook 0
00372 #endif
00373 #ifndef elf_backend_create_dynamic_sections
00374 #define elf_backend_create_dynamic_sections 0
00375 #endif
00376 #ifndef elf_backend_omit_section_dynsym
00377 #define elf_backend_omit_section_dynsym _bfd_elf_link_omit_section_dynsym
00378 #endif
00379 #ifndef elf_backend_check_relocs
00380 #define elf_backend_check_relocs   0
00381 #endif
00382 #ifndef elf_backend_check_directives
00383 #define elf_backend_check_directives      0
00384 #endif
00385 #ifndef elf_backend_as_needed_cleanup
00386 #define elf_backend_as_needed_cleanup     0
00387 #endif
00388 #ifndef elf_backend_adjust_dynamic_symbol
00389 #define elf_backend_adjust_dynamic_symbol 0
00390 #endif
00391 #ifndef elf_backend_always_size_sections
00392 #define elf_backend_always_size_sections 0
00393 #endif
00394 #ifndef elf_backend_size_dynamic_sections
00395 #define elf_backend_size_dynamic_sections 0
00396 #endif
00397 #ifndef elf_backend_init_index_section
00398 #define elf_backend_init_index_section \
00399  ((void (*) (bfd *, struct bfd_link_info *)) bfd_void)
00400 #endif
00401 #ifndef elf_backend_relocate_section
00402 #define elf_backend_relocate_section      0
00403 #endif
00404 #ifndef elf_backend_finish_dynamic_symbol
00405 #define elf_backend_finish_dynamic_symbol 0
00406 #endif
00407 #ifndef elf_backend_finish_dynamic_sections
00408 #define elf_backend_finish_dynamic_sections      0
00409 #endif
00410 #ifndef elf_backend_begin_write_processing
00411 #define elf_backend_begin_write_processing       0
00412 #endif
00413 #ifndef elf_backend_final_write_processing
00414 #define elf_backend_final_write_processing       0
00415 #endif
00416 #ifndef elf_backend_additional_program_headers
00417 #define elf_backend_additional_program_headers   0
00418 #endif
00419 #ifndef elf_backend_modify_segment_map
00420 #define elf_backend_modify_segment_map    0
00421 #endif
00422 #ifndef elf_backend_modify_program_headers
00423 #define elf_backend_modify_program_headers       0
00424 #endif
00425 #ifndef elf_backend_ecoff_debug_swap
00426 #define elf_backend_ecoff_debug_swap      0
00427 #endif
00428 #ifndef elf_backend_bfd_from_remote_memory
00429 #define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory
00430 #endif
00431 #ifndef elf_backend_got_header_size
00432 #define elf_backend_got_header_size       0
00433 #endif
00434 #ifndef elf_backend_post_process_headers
00435 #define elf_backend_post_process_headers  NULL
00436 #endif
00437 #ifndef elf_backend_print_symbol_all
00438 #define elf_backend_print_symbol_all             NULL
00439 #endif
00440 #ifndef elf_backend_output_arch_local_syms
00441 #define elf_backend_output_arch_local_syms       NULL
00442 #endif
00443 #ifndef elf_backend_output_arch_syms
00444 #define elf_backend_output_arch_syms             NULL
00445 #endif
00446 #ifndef elf_backend_copy_indirect_symbol
00447 #define elf_backend_copy_indirect_symbol  _bfd_elf_link_hash_copy_indirect
00448 #endif
00449 #ifndef elf_backend_hide_symbol
00450 #define elf_backend_hide_symbol           _bfd_elf_link_hash_hide_symbol
00451 #endif
00452 #ifndef elf_backend_fixup_symbol
00453 #define elf_backend_fixup_symbol          NULL   
00454 #endif
00455 #ifndef elf_backend_merge_symbol_attribute
00456 #define elf_backend_merge_symbol_attribute       NULL
00457 #endif
00458 #ifndef elf_backend_ignore_undef_symbol
00459 #define elf_backend_ignore_undef_symbol          NULL
00460 #endif
00461 #ifndef elf_backend_emit_relocs
00462 #define elf_backend_emit_relocs                  _bfd_elf_link_output_relocs
00463 #endif
00464 #ifndef elf_backend_count_relocs
00465 #define elf_backend_count_relocs          NULL
00466 #endif
00467 #ifndef elf_backend_grok_prstatus
00468 #define elf_backend_grok_prstatus         NULL
00469 #endif
00470 #ifndef elf_backend_grok_psinfo
00471 #define elf_backend_grok_psinfo                  NULL
00472 #endif
00473 #ifndef elf_backend_write_core_note
00474 #define elf_backend_write_core_note              NULL
00475 #endif
00476 #ifndef elf_backend_sprintf_vma
00477 #define elf_backend_sprintf_vma                  _bfd_elf_sprintf_vma
00478 #endif
00479 #ifndef elf_backend_fprintf_vma
00480 #define elf_backend_fprintf_vma                  _bfd_elf_fprintf_vma
00481 #endif
00482 #ifndef elf_backend_reloc_type_class
00483 #define elf_backend_reloc_type_class             _bfd_elf_reloc_type_class
00484 #endif
00485 #ifndef elf_backend_discard_info
00486 #define elf_backend_discard_info          NULL
00487 #endif
00488 #ifndef elf_backend_ignore_discarded_relocs
00489 #define elf_backend_ignore_discarded_relocs      NULL
00490 #endif
00491 #ifndef elf_backend_action_discarded
00492 #define elf_backend_action_discarded _bfd_elf_default_action_discarded
00493 #endif
00494 #ifndef elf_backend_eh_frame_address_size
00495 #define elf_backend_eh_frame_address_size _bfd_elf_eh_frame_address_size
00496 #endif
00497 #ifndef elf_backend_can_make_relative_eh_frame
00498 #define elf_backend_can_make_relative_eh_frame   _bfd_elf_can_make_relative
00499 #endif
00500 #ifndef elf_backend_can_make_lsda_relative_eh_frame
00501 #define elf_backend_can_make_lsda_relative_eh_frame     _bfd_elf_can_make_relative
00502 #endif
00503 #ifndef elf_backend_encode_eh_address
00504 #define elf_backend_encode_eh_address            _bfd_elf_encode_eh_address
00505 #endif
00506 #ifndef elf_backend_write_section
00507 #define elf_backend_write_section         NULL
00508 #endif
00509 #ifndef elf_backend_mips_irix_compat
00510 #define elf_backend_mips_irix_compat             NULL
00511 #endif
00512 #ifndef elf_backend_mips_rtype_to_howto
00513 #define elf_backend_mips_rtype_to_howto          NULL
00514 #endif
00515 
00516 /* Previously, backends could only use SHT_REL or SHT_RELA relocation
00517    sections, but not both.  They defined USE_REL to indicate SHT_REL
00518    sections, and left it undefined to indicated SHT_RELA sections.
00519    For backwards compatibility, we still support this usage.  */
00520 #ifndef USE_REL
00521 #define USE_REL 0
00522 #endif
00523 
00524 /* Use these in new code.  */
00525 #ifndef elf_backend_may_use_rel_p
00526 #define elf_backend_may_use_rel_p USE_REL
00527 #endif
00528 #ifndef elf_backend_may_use_rela_p
00529 #define elf_backend_may_use_rela_p !USE_REL
00530 #endif
00531 #ifndef elf_backend_default_use_rela_p
00532 #define elf_backend_default_use_rela_p !USE_REL
00533 #endif
00534 
00535 #ifndef elf_backend_rela_normal
00536 #define elf_backend_rela_normal 0
00537 #endif
00538 
00539 #ifndef elf_backend_plt_sym_val
00540 #define elf_backend_plt_sym_val NULL
00541 #endif
00542 #ifndef elf_backend_relplt_name
00543 #define elf_backend_relplt_name NULL
00544 #endif
00545 
00546 #ifndef ELF_MACHINE_ALT1
00547 #define ELF_MACHINE_ALT1 0
00548 #endif
00549 
00550 #ifndef ELF_MACHINE_ALT2
00551 #define ELF_MACHINE_ALT2 0
00552 #endif
00553 
00554 #ifndef elf_backend_size_info
00555 #define elf_backend_size_info _bfd_elfNN_size_info
00556 #endif
00557 
00558 #ifndef elf_backend_special_sections
00559 #define elf_backend_special_sections NULL
00560 #endif
00561 
00562 #ifndef elf_backend_sign_extend_vma
00563 #define elf_backend_sign_extend_vma 0
00564 #endif
00565 
00566 #ifndef elf_backend_link_order_error_handler
00567 #define elf_backend_link_order_error_handler _bfd_default_error_handler
00568 #endif
00569 
00570 #ifndef elf_backend_common_definition
00571 #define elf_backend_common_definition _bfd_elf_common_definition
00572 #endif
00573 
00574 #ifndef elf_backend_common_section_index
00575 #define elf_backend_common_section_index _bfd_elf_common_section_index
00576 #endif
00577 
00578 #ifndef elf_backend_common_section
00579 #define elf_backend_common_section _bfd_elf_common_section
00580 #endif
00581 
00582 #ifndef elf_backend_merge_symbol
00583 #define elf_backend_merge_symbol NULL
00584 #endif
00585 
00586 #ifndef elf_backend_hash_symbol
00587 #define elf_backend_hash_symbol _bfd_elf_hash_symbol
00588 #endif
00589 
00590 extern const struct elf_size_info _bfd_elfNN_size_info;
00591 
00592 static struct elf_backend_data elfNN_bed =
00593 {
00594   ELF_ARCH,                 /* arch */
00595   ELF_MACHINE_CODE,         /* elf_machine_code */
00596   ELF_OSABI,                /* elf_osabi  */
00597   ELF_MAXPAGESIZE,          /* maxpagesize */
00598   ELF_MINPAGESIZE,          /* minpagesize */
00599   ELF_COMMONPAGESIZE,              /* commonpagesize */
00600   ELF_DYNAMIC_SEC_FLAGS,    /* dynamic_sec_flags */
00601   elf_info_to_howto,
00602   elf_info_to_howto_rel,
00603   elf_backend_sym_is_global,
00604   elf_backend_object_p,
00605   elf_backend_symbol_processing,
00606   elf_backend_symbol_table_processing,
00607   elf_backend_get_symbol_type,
00608   elf_backend_archive_symbol_lookup,
00609   elf_backend_name_local_section_symbols,
00610   elf_backend_section_processing,
00611   elf_backend_section_from_shdr,
00612   elf_backend_section_flags,
00613   elf_backend_get_sec_type_attr,
00614   elf_backend_section_from_phdr,
00615   elf_backend_fake_sections,
00616   elf_backend_section_from_bfd_section,
00617   elf_backend_add_symbol_hook,
00618   elf_backend_link_output_symbol_hook,
00619   elf_backend_create_dynamic_sections,
00620   elf_backend_omit_section_dynsym,
00621   elf_backend_check_relocs,
00622   elf_backend_check_directives,
00623   elf_backend_as_needed_cleanup,
00624   elf_backend_adjust_dynamic_symbol,
00625   elf_backend_always_size_sections,
00626   elf_backend_size_dynamic_sections,
00627   elf_backend_init_index_section,
00628   elf_backend_relocate_section,
00629   elf_backend_finish_dynamic_symbol,
00630   elf_backend_finish_dynamic_sections,
00631   elf_backend_begin_write_processing,
00632   elf_backend_final_write_processing,
00633   elf_backend_additional_program_headers,
00634   elf_backend_modify_segment_map,
00635   elf_backend_modify_program_headers,
00636   elf_backend_gc_mark_dynamic_ref,
00637   elf_backend_gc_mark_hook,
00638   elf_backend_gc_mark_extra_sections,
00639   elf_backend_gc_sweep_hook,
00640   elf_backend_post_process_headers,
00641   elf_backend_print_symbol_all,
00642   elf_backend_output_arch_local_syms,
00643   elf_backend_output_arch_syms,
00644   elf_backend_copy_indirect_symbol,
00645   elf_backend_hide_symbol,
00646   elf_backend_fixup_symbol,
00647   elf_backend_merge_symbol_attribute,
00648   elf_backend_ignore_undef_symbol,
00649   elf_backend_emit_relocs,
00650   elf_backend_count_relocs,
00651   elf_backend_grok_prstatus,
00652   elf_backend_grok_psinfo,
00653   elf_backend_write_core_note,
00654   elf_backend_sprintf_vma,
00655   elf_backend_fprintf_vma,
00656   elf_backend_reloc_type_class,
00657   elf_backend_discard_info,
00658   elf_backend_ignore_discarded_relocs,
00659   elf_backend_action_discarded,
00660   elf_backend_eh_frame_address_size,
00661   elf_backend_can_make_relative_eh_frame,
00662   elf_backend_can_make_lsda_relative_eh_frame,
00663   elf_backend_encode_eh_address,
00664   elf_backend_write_section,
00665   elf_backend_mips_irix_compat,
00666   elf_backend_mips_rtype_to_howto,
00667   elf_backend_ecoff_debug_swap,
00668   elf_backend_bfd_from_remote_memory,
00669   elf_backend_plt_sym_val,
00670   elf_backend_common_definition,
00671   elf_backend_common_section_index,
00672   elf_backend_common_section,
00673   elf_backend_merge_symbol,
00674   elf_backend_hash_symbol,
00675   elf_backend_link_order_error_handler,
00676   elf_backend_relplt_name,
00677   ELF_MACHINE_ALT1,
00678   ELF_MACHINE_ALT2,
00679   &elf_backend_size_info,
00680   elf_backend_special_sections,
00681   elf_backend_got_header_size,
00682   elf_backend_collect,
00683   elf_backend_type_change_ok,
00684   elf_backend_may_use_rel_p,
00685   elf_backend_may_use_rela_p,
00686   elf_backend_default_use_rela_p,
00687   elf_backend_rela_normal,
00688   elf_backend_sign_extend_vma,
00689   elf_backend_want_got_plt,
00690   elf_backend_plt_readonly,
00691   elf_backend_want_plt_sym,
00692   elf_backend_plt_not_loaded,
00693   elf_backend_plt_alignment,
00694   elf_backend_can_gc_sections,
00695   elf_backend_can_refcount,
00696   elf_backend_want_got_sym,
00697   elf_backend_want_dynbss,
00698   elf_backend_want_p_paddr_set_to_zero,
00699   elf_backend_default_execstack
00700 };
00701 
00702 /* Forward declaration for use when initialising alternative_target field.  */
00703 #ifdef TARGET_LITTLE_SYM
00704 extern const bfd_target TARGET_LITTLE_SYM;
00705 #endif
00706 
00707 #ifdef TARGET_BIG_SYM
00708 const bfd_target TARGET_BIG_SYM =
00709 {
00710   /* name: identify kind of target */
00711   TARGET_BIG_NAME,
00712 
00713   /* flavour: general indication about file */
00714   bfd_target_elf_flavour,
00715 
00716   /* byteorder: data is big endian */
00717   BFD_ENDIAN_BIG,
00718 
00719   /* header_byteorder: header is also big endian */
00720   BFD_ENDIAN_BIG,
00721 
00722   /* object_flags: mask of all file flags */
00723   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
00724    | DYNAMIC | WP_TEXT | D_PAGED),
00725 
00726   /* section_flags: mask of all section flags */
00727   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
00728    | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
00729    | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
00730 
00731    /* leading_symbol_char: is the first char of a user symbol
00732       predictable, and if so what is it */
00733   elf_symbol_leading_char,
00734 
00735   /* ar_pad_char: pad character for filenames within an archive header
00736      FIXME:  this really has nothing to do with ELF, this is a characteristic
00737      of the archiver and/or os and should be independently tunable */
00738   '/',
00739 
00740   /* ar_max_namelen: maximum number of characters in an archive header
00741      FIXME:  this really has nothing to do with ELF, this is a characteristic
00742      of the archiver and should be independently tunable.  The System V ABI,
00743      Chapter 7 (Formats & Protocols), Archive section sets this as 15.  */
00744   15,
00745 
00746   /* Routines to byte-swap various sized integers from the data sections */
00747   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00748     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00749     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
00750 
00751   /* Routines to byte-swap various sized integers from the file headers */
00752   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
00753     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
00754     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
00755 
00756   /* bfd_check_format: check the format of a file being read */
00757   { _bfd_dummy_target,             /* unknown format */
00758     bfd_elfNN_object_p,            /* assembler/linker output (object file) */
00759     bfd_elfNN_archive_p,    /* an archive */
00760     bfd_elfNN_core_file_p   /* a core file */
00761   },
00762 
00763   /* bfd_set_format: set the format of a file being written */
00764   { bfd_false,
00765     bfd_elfNN_mkobject,
00766     bfd_elfNN_mkarchive,
00767     bfd_elfNN_mkcorefile
00768   },
00769 
00770   /* bfd_write_contents: write cached information into a file being written */
00771   { bfd_false,
00772     bfd_elfNN_write_object_contents,
00773     bfd_elfNN_write_archive_contents,
00774     bfd_elfNN_write_corefile_contents,
00775   },
00776 
00777   BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
00778   BFD_JUMP_TABLE_COPY (bfd_elfNN),
00779   BFD_JUMP_TABLE_CORE (bfd_elfNN),
00780 #ifdef bfd_elfNN_archive_functions
00781   BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive),
00782 #else
00783   BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
00784 #endif
00785   BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN),
00786   BFD_JUMP_TABLE_RELOCS (bfd_elfNN),
00787   BFD_JUMP_TABLE_WRITE (bfd_elfNN),
00788   BFD_JUMP_TABLE_LINK (bfd_elfNN),
00789   BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
00790 
00791   /* Alternative endian target.  */
00792 #ifdef TARGET_LITTLE_SYM
00793   & TARGET_LITTLE_SYM,
00794 #else
00795   NULL,
00796 #endif
00797 
00798   /* backend_data: */
00799   &elfNN_bed
00800 };
00801 #endif
00802 
00803 #ifdef TARGET_LITTLE_SYM
00804 const bfd_target TARGET_LITTLE_SYM =
00805 {
00806   /* name: identify kind of target */
00807   TARGET_LITTLE_NAME,
00808 
00809   /* flavour: general indication about file */
00810   bfd_target_elf_flavour,
00811 
00812   /* byteorder: data is little endian */
00813   BFD_ENDIAN_LITTLE,
00814 
00815   /* header_byteorder: header is also little endian */
00816   BFD_ENDIAN_LITTLE,
00817 
00818   /* object_flags: mask of all file flags */
00819   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
00820    | DYNAMIC | WP_TEXT | D_PAGED),
00821 
00822   /* section_flags: mask of all section flags */
00823   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
00824    | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
00825    | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
00826 
00827    /* leading_symbol_char: is the first char of a user symbol
00828       predictable, and if so what is it */
00829   elf_symbol_leading_char,
00830 
00831   /* ar_pad_char: pad character for filenames within an archive header
00832      FIXME:  this really has nothing to do with ELF, this is a characteristic
00833      of the archiver and/or os and should be independently tunable */
00834   '/',
00835 
00836   /* ar_max_namelen: maximum number of characters in an archive header
00837      FIXME:  this really has nothing to do with ELF, this is a characteristic
00838      of the archiver and should be independently tunable.  The System V ABI,
00839      Chapter 7 (Formats & Protocols), Archive section sets this as 15.  */
00840   15,
00841 
00842   /* Routines to byte-swap various sized integers from the data sections */
00843   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
00844     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
00845     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
00846 
00847   /* Routines to byte-swap various sized integers from the file headers */
00848   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
00849     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
00850     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
00851 
00852   /* bfd_check_format: check the format of a file being read */
00853   { _bfd_dummy_target,             /* unknown format */
00854     bfd_elfNN_object_p,            /* assembler/linker output (object file) */
00855     bfd_elfNN_archive_p,    /* an archive */
00856     bfd_elfNN_core_file_p   /* a core file */
00857   },
00858 
00859   /* bfd_set_format: set the format of a file being written */
00860   { bfd_false,
00861     bfd_elfNN_mkobject,
00862     bfd_elfNN_mkarchive,
00863     bfd_elfNN_mkcorefile
00864   },
00865 
00866   /* bfd_write_contents: write cached information into a file being written */
00867   { bfd_false,
00868     bfd_elfNN_write_object_contents,
00869     bfd_elfNN_write_archive_contents,
00870     bfd_elfNN_write_corefile_contents,
00871   },
00872 
00873   BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
00874   BFD_JUMP_TABLE_COPY (bfd_elfNN),
00875   BFD_JUMP_TABLE_CORE (bfd_elfNN),
00876 #ifdef bfd_elfNN_archive_functions
00877   BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive),
00878 #else
00879   BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
00880 #endif
00881   BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN),
00882   BFD_JUMP_TABLE_RELOCS (bfd_elfNN),
00883   BFD_JUMP_TABLE_WRITE (bfd_elfNN),
00884   BFD_JUMP_TABLE_LINK (bfd_elfNN),
00885   BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
00886 
00887   /* Alternative endian target.  */
00888 #ifdef TARGET_BIG_SYM
00889   & TARGET_BIG_SYM,
00890 #else
00891   NULL,
00892 #endif
00893 
00894   /* backend_data: */
00895   &elfNN_bed
00896 };
00897 #endif