X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Ftargets.c;h=804da96b21f685560f0e0e0dc4dbe5c03b654b95;hb=4e7fd91e3e0087cccd56dd0ebfbc5e4c5407e1ac;hp=f903cc327bb0bbb3347d2291d772a6f264fb828c;hpb=c58b95236ce4c9345c4fa76e7ef16762e5229380;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/targets.c b/bfd/targets.c index f903cc327b..804da96b21 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -1,6 +1,6 @@ /* Generic target-file-type support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Cygnus Support. @@ -30,7 +30,7 @@ SECTION Targets DESCRIPTION - Each port of BFD to a different machine requries the creation + Each port of BFD to a different machine requires the creation of a target back end. All the back end provides to the root part of BFD is a structure containing pointers to functions which perform certain low level operations on files. BFD @@ -203,26 +203,26 @@ DESCRIPTION . {* Entries for byte swapping for data. These are different from the . other entry points, since they don't take a BFD asthe first argument. . Certain other handlers could do the same. *} -. bfd_vma (*bfd_getx64) (const bfd_byte *); -. bfd_signed_vma (*bfd_getx_signed_64) (const bfd_byte *); -. void (*bfd_putx64) (bfd_vma, bfd_byte *); -. bfd_vma (*bfd_getx32) (const bfd_byte *); -. bfd_signed_vma (*bfd_getx_signed_32) (const bfd_byte *); -. void (*bfd_putx32) (bfd_vma, bfd_byte *); -. bfd_vma (*bfd_getx16) (const bfd_byte *); -. bfd_signed_vma (*bfd_getx_signed_16) (const bfd_byte *); -. void (*bfd_putx16) (bfd_vma, bfd_byte *); +. bfd_uint64_t (*bfd_getx64) (const void *); +. bfd_int64_t (*bfd_getx_signed_64) (const void *); +. void (*bfd_putx64) (bfd_uint64_t, void *); +. bfd_vma (*bfd_getx32) (const void *); +. bfd_signed_vma (*bfd_getx_signed_32) (const void *); +. void (*bfd_putx32) (bfd_vma, void *); +. bfd_vma (*bfd_getx16) (const void *); +. bfd_signed_vma (*bfd_getx_signed_16) (const void *); +. void (*bfd_putx16) (bfd_vma, void *); . . {* Byte swapping for the headers. *} -. bfd_vma (*bfd_h_getx64) (const bfd_byte *); -. bfd_signed_vma (*bfd_h_getx_signed_64) (const bfd_byte *); -. void (*bfd_h_putx64) (bfd_vma, bfd_byte *); -. bfd_vma (*bfd_h_getx32) (const bfd_byte *); -. bfd_signed_vma (*bfd_h_getx_signed_32) (const bfd_byte *); -. void (*bfd_h_putx32) (bfd_vma, bfd_byte *); -. bfd_vma (*bfd_h_getx16) (const bfd_byte *); -. bfd_signed_vma (*bfd_h_getx_signed_16) (const bfd_byte *); -. void (*bfd_h_putx16) (bfd_vma, bfd_byte *); +. bfd_uint64_t (*bfd_h_getx64) (const void *); +. bfd_int64_t (*bfd_h_getx_signed_64) (const void *); +. void (*bfd_h_putx64) (bfd_uint64_t, void *); +. bfd_vma (*bfd_h_getx32) (const void *); +. bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); +. void (*bfd_h_putx32) (bfd_vma, void *); +. bfd_vma (*bfd_h_getx16) (const void *); +. bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); +. void (*bfd_h_putx16) (bfd_vma, void *); . . {* Format dependent routines: these are vectors of entry points . within the target vector structure, one for each format to check. *} @@ -265,6 +265,7 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_merge_private_bfd_data, \ . NAME##_bfd_copy_private_section_data, \ . NAME##_bfd_copy_private_symbol_data, \ +. NAME##_bfd_copy_private_header_data, \ . NAME##_bfd_set_private_flags, \ . NAME##_bfd_print_private_bfd_data . @@ -282,6 +283,10 @@ BFD_JUMP_TABLE macros. . to another. *} . bfd_boolean (*_bfd_copy_private_symbol_data) . (bfd *, asymbol *, bfd *, asymbol *); +. {* Called to copy BFD private header data from one object file +. to another. *} +. bfd_boolean (*_bfd_copy_private_header_data) +. (bfd *, bfd *); . {* Called to set private backend flags. *} . bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); . @@ -328,11 +333,12 @@ BFD_JUMP_TABLE macros. . {* Entry points used for symbols. *} .#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ . NAME##_get_symtab_upper_bound, \ -. NAME##_get_symtab, \ +. NAME##_canonicalize_symtab, \ . NAME##_make_empty_symbol, \ . NAME##_print_symbol, \ . NAME##_get_symbol_info, \ . NAME##_bfd_is_local_label_name, \ +. NAME##_bfd_is_target_special_symbol, \ . NAME##_get_lineno, \ . NAME##_find_nearest_line, \ . NAME##_bfd_make_debug_symbol, \ @@ -341,20 +347,20 @@ BFD_JUMP_TABLE macros. . . long (*_bfd_get_symtab_upper_bound) (bfd *); . long (*_bfd_canonicalize_symtab) -. (bfd *, struct symbol_cache_entry **); -. struct symbol_cache_entry * +. (bfd *, struct bfd_symbol **); +. struct bfd_symbol * . (*_bfd_make_empty_symbol) (bfd *); . void (*_bfd_print_symbol) -. (bfd *, void *, struct symbol_cache_entry *, bfd_print_symbol_type); +. (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); .#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) . void (*_bfd_get_symbol_info) -. (bfd *, struct symbol_cache_entry *, symbol_info *); +. (bfd *, struct bfd_symbol *, symbol_info *); .#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) . bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); -. -. alent * (*_get_lineno) (bfd *, struct symbol_cache_entry *); +. bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); +. alent * (*_get_lineno) (bfd *, struct bfd_symbol *); . bfd_boolean (*_bfd_find_nearest_line) -. (bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, +. (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, . const char **, const char **, unsigned int *); . {* Back-door to allow format-aware applications to create debug symbols . while using BFD for everything else. Currently used by the assembler @@ -378,7 +384,7 @@ BFD_JUMP_TABLE macros. . . long (*_get_reloc_upper_bound) (bfd *, sec_ptr); . long (*_bfd_canonicalize_reloc) -. (bfd *, sec_ptr, arelent **, struct symbol_cache_entry **); +. (bfd *, sec_ptr, arelent **, struct bfd_symbol **); . {* See documentation on reloc types. *} . reloc_howto_type * . (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); @@ -391,7 +397,7 @@ BFD_JUMP_TABLE macros. . bfd_boolean (*_bfd_set_arch_mach) . (bfd *, enum bfd_architecture, unsigned long); . bfd_boolean (*_bfd_set_section_contents) -. (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); +. (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); . . {* Routines used by the linker. *} .#define BFD_JUMP_TABLE_LINK(NAME) \ @@ -406,15 +412,17 @@ BFD_JUMP_TABLE macros. . NAME##_bfd_link_split_section, \ . NAME##_bfd_gc_sections, \ . NAME##_bfd_merge_sections, \ -. NAME##_bfd_discard_group +. NAME##_bfd_is_group_section, \ +. NAME##_bfd_discard_group, \ +. NAME##_section_already_linked \ . . int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); . bfd_byte * (*_bfd_get_relocated_section_contents) . (bfd *, struct bfd_link_info *, struct bfd_link_order *, -. bfd_byte *, bfd_boolean, struct symbol_cache_entry **); +. bfd_byte *, bfd_boolean, struct bfd_symbol **); . . bfd_boolean (*_bfd_relax_section) -. (bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *); +. (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); . . {* Create a hash table for the linker. Different backends store . different information in this table. *} @@ -435,7 +443,7 @@ BFD_JUMP_TABLE macros. . bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); . . {* Should this section be split up into smaller pieces during linking. *} -. bfd_boolean (*_bfd_link_split_section) (bfd *, struct sec *); +. bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); . . {* Remove sections that are not referenced from the output. *} . bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); @@ -443,13 +451,21 @@ BFD_JUMP_TABLE macros. . {* Attempt to merge SEC_MERGE sections. *} . bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); . +. {* Is this section a member of a group? *} +. bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); +. . {* Discard members of a group. *} -. bfd_boolean (*_bfd_discard_group) (bfd *, struct sec *); +. bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); +. +. {* Check if SEC has been already linked during a reloceatable or +. final link. *} +. void (*_section_already_linked) (bfd *, struct bfd_section *); . . {* Routines to handle dynamic symbols and relocs. *} .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ . NAME##_get_dynamic_symtab_upper_bound, \ . NAME##_canonicalize_dynamic_symtab, \ +. NAME##_get_synthetic_symtab, \ . NAME##_get_dynamic_reloc_upper_bound, \ . NAME##_canonicalize_dynamic_reloc . @@ -457,12 +473,16 @@ BFD_JUMP_TABLE macros. . long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); . {* Read in the dynamic symbols. *} . long (*_bfd_canonicalize_dynamic_symtab) -. (bfd *, struct symbol_cache_entry **); +. (bfd *, struct bfd_symbol **); +. {* Create synthetized symbols. *} +. long (*_bfd_get_synthetic_symtab) +. (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, +. struct bfd_symbol **); . {* Get the amount of memory required to hold the dynamic relocs. *} . long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); . {* Read in the dynamic relocs. *} . long (*_bfd_canonicalize_dynamic_reloc) -. (bfd *, arelent **, struct symbol_cache_entry **); +. (bfd *, arelent **, struct bfd_symbol **); . A pointer to an alternative bfd_target in case the current one is not @@ -477,7 +497,7 @@ to find an alternative output format that is suitable. . {* Data for use by back-end routines, which isn't . generic enough to belong in this structure. *} -. void *backend_data; +. const void *backend_data; . .} bfd_target; . @@ -514,17 +534,22 @@ extern const bfd_target bfd_efi_app_ia64_vec; extern const bfd_target bfd_elf32_avr_vec; extern const bfd_target bfd_elf32_big_generic_vec; extern const bfd_target bfd_elf32_bigarc_vec; -extern const bfd_target bfd_elf32_bigarm_oabi_vec; extern const bfd_target bfd_elf32_bigarm_vec; +extern const bfd_target bfd_elf32_bigarm_symbian_vec; +extern const bfd_target bfd_elf32_bigarm_vxworks_vec; extern const bfd_target bfd_elf32_bigmips_vec; +extern const bfd_target bfd_elf32_cr16c_vec; extern const bfd_target bfd_elf32_cris_vec; +extern const bfd_target bfd_elf32_crx_vec; extern const bfd_target bfd_elf32_d10v_vec; extern const bfd_target bfd_elf32_d30v_vec; extern const bfd_target bfd_elf32_dlx_big_vec; extern const bfd_target bfd_elf32_fr30_vec; extern const bfd_target bfd_elf32_frv_vec; +extern const bfd_target bfd_elf32_frvfdpic_vec; extern const bfd_target bfd_elf32_h8300_vec; extern const bfd_target bfd_elf32_hppa_linux_vec; +extern const bfd_target bfd_elf32_hppa_nbsd_vec; extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_i370_vec; extern const bfd_target bfd_elf32_i386_freebsd_vec; @@ -538,10 +563,14 @@ extern const bfd_target bfd_elf32_ip2k_vec; extern const bfd_target bfd_elf32_iq2000_vec; extern const bfd_target bfd_elf32_little_generic_vec; extern const bfd_target bfd_elf32_littlearc_vec; -extern const bfd_target bfd_elf32_littlearm_oabi_vec; extern const bfd_target bfd_elf32_littlearm_vec; +extern const bfd_target bfd_elf32_littlearm_symbian_vec; +extern const bfd_target bfd_elf32_littlearm_vxworks_vec; extern const bfd_target bfd_elf32_littlemips_vec; extern const bfd_target bfd_elf32_m32r_vec; +extern const bfd_target bfd_elf32_m32rle_vec; +extern const bfd_target bfd_elf32_m32rlin_vec; +extern const bfd_target bfd_elf32_m32rlelin_vec; extern const bfd_target bfd_elf32_m68hc11_vec; extern const bfd_target bfd_elf32_m68hc12_vec; extern const bfd_target bfd_elf32_m68k_vec; @@ -571,6 +600,7 @@ extern const bfd_target bfd_elf32_sh64nbsd_vec; extern const bfd_target bfd_elf32_sh_vec; extern const bfd_target bfd_elf32_shblin_vec; extern const bfd_target bfd_elf32_shl_vec; +extern const bfd_target bfd_elf32_shl_symbian_vec; extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_shlnbsd_vec; extern const bfd_target bfd_elf32_shnbsd_vec; @@ -589,8 +619,6 @@ extern const bfd_target bfd_elf64_big_generic_vec; extern const bfd_target bfd_elf64_bigmips_vec; extern const bfd_target bfd_elf64_hppa_linux_vec; extern const bfd_target bfd_elf64_hppa_vec; -extern const bfd_target bfd_elf64_ia64_aix_big_vec; -extern const bfd_target bfd_elf64_ia64_aix_little_vec; extern const bfd_target bfd_elf64_ia64_big_vec; extern const bfd_target bfd_elf64_ia64_hpux_big_vec; extern const bfd_target bfd_elf64_ia64_little_vec; @@ -657,9 +685,11 @@ extern const bfd_target m68knetbsd_vec; extern const bfd_target m68ksysvcoff_vec; extern const bfd_target m88kbcs_vec; extern const bfd_target m88kmach3_vec; +extern const bfd_target m88kopenbsd_vec; extern const bfd_target mach_o_be_vec; extern const bfd_target mach_o_le_vec; extern const bfd_target mach_o_fat_vec; +extern const bfd_target maxqcoff_vec; extern const bfd_target mcore_pe_big_vec; extern const bfd_target mcore_pe_little_vec; extern const bfd_target mcore_pei_big_vec; @@ -743,6 +773,7 @@ extern const bfd_target ptrace_core_vec; extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; +extern const bfd_target bfd_elf32_am33lin_vec; static const bfd_target * const _bfd_target_vector[] = { #ifdef SELECT_VECS @@ -802,17 +833,22 @@ static const bfd_target * const _bfd_target_vector[] = { the file even if we don't recognize the machine type. */ &bfd_elf32_big_generic_vec, &bfd_elf32_bigarc_vec, - &bfd_elf32_bigarm_oabi_vec, &bfd_elf32_bigarm_vec, + &bfd_elf32_bigarm_symbian_vec, + &bfd_elf32_bigarm_vxworks_vec, &bfd_elf32_bigmips_vec, + &bfd_elf32_cr16c_vec, &bfd_elf32_cris_vec, + &bfd_elf32_crx_vec, &bfd_elf32_d10v_vec, &bfd_elf32_d30v_vec, &bfd_elf32_dlx_big_vec, &bfd_elf32_fr30_vec, &bfd_elf32_frv_vec, + &bfd_elf32_frvfdpic_vec, &bfd_elf32_h8300_vec, &bfd_elf32_hppa_linux_vec, + &bfd_elf32_hppa_nbsd_vec, &bfd_elf32_hppa_vec, &bfd_elf32_i370_vec, &bfd_elf32_i386_freebsd_vec, @@ -828,10 +864,14 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_iq2000_vec, &bfd_elf32_little_generic_vec, &bfd_elf32_littlearc_vec, - &bfd_elf32_littlearm_oabi_vec, &bfd_elf32_littlearm_vec, + &bfd_elf32_littlearm_symbian_vec, + &bfd_elf32_littlearm_vxworks_vec, &bfd_elf32_littlemips_vec, &bfd_elf32_m32r_vec, + &bfd_elf32_m32rle_vec, + &bfd_elf32_m32rlin_vec, + &bfd_elf32_m32rlelin_vec, &bfd_elf32_m68hc11_vec, &bfd_elf32_m68hc12_vec, &bfd_elf32_m68k_vec, @@ -857,6 +897,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_sh_vec, &bfd_elf32_shblin_vec, &bfd_elf32_shl_vec, + &bfd_elf32_shl_symbian_vec, &bfd_elf32_shlin_vec, &bfd_elf32_shlnbsd_vec, &bfd_elf32_shnbsd_vec, @@ -884,8 +925,6 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_bigmips_vec, &bfd_elf64_hppa_linux_vec, &bfd_elf64_hppa_vec, - &bfd_elf64_ia64_aix_big_vec, - &bfd_elf64_ia64_aix_little_vec, &bfd_elf64_ia64_big_vec, &bfd_elf64_ia64_hpux_big_vec, &bfd_elf64_ia64_little_vec, @@ -901,9 +940,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_sh64nbsd_vec, &bfd_elf64_sh64lin_vec, &bfd_elf64_sh64blin_vec, -#if 0 &bfd_elf64_sparc_vec, -#endif &bfd_elf64_tradbigmips_vec, &bfd_elf64_tradlittlemips_vec, &bfd_elf64_x86_64_vec, @@ -979,9 +1016,11 @@ static const bfd_target * const _bfd_target_vector[] = { &m68ksysvcoff_vec, &m88kbcs_vec, &m88kmach3_vec, + &m88kopenbsd_vec, &mach_o_be_vec, &mach_o_le_vec, &mach_o_fat_vec, + &maxqcoff_vec, &mcore_pe_big_vec, &mcore_pe_little_vec, &mcore_pei_big_vec, @@ -1061,6 +1100,7 @@ static const bfd_target * const _bfd_target_vector[] = { &w65_vec, &we32kcoff_vec, &z8kcoff_vec, + &bfd_elf32_am33lin_vec, #endif /* not SELECT_VECS */ /* Always support S-records, for convenience. */