Add target_id to elf_backend_data.
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 25 Aug 2010 14:53:45 +0000 (14:53 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 25 Aug 2010 14:53:45 +0000 (14:53 +0000)
2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/11944
* elf-bfd.h (elf_backend_data): Add target_id.
(bfd_elf_make_generic_object): Renamed to ...
(bfd_elf_make_object): This.

* elf.c (bfd_elf_make_generic_object): Removed.
(bfd_elf_make_object): New.
(bfd_elf_mkcorefile): Really treat it as an object file.

* elf-m10300.c (ELF_TARGET_ID): New.
* elf32-arm.c (ELF_TARGET_ID): Likewise.
* elf32-bfin.c (ELF_TARGET_ID): Likewise.
* elf32-cris.c (ELF_TARGET_ID): Likewise.
* elf32-frv.c (ELF_TARGET_ID): Likewise.
* elf32-i386.c (ELF_TARGET_ID): Likewise.
* elf32-lm32.c (ELF_TARGET_ID): Likewise.
* elf32-m32r.c (ELF_TARGET_ID): Likewise.
* elf32-m68hc11.c (ELF_TARGET_ID): Likewise.
* elf32-m68hc12.c (ELF_TARGET_ID): Likewise.
* elf32-m68k.c (ELF_TARGET_ID): Likewise.
* elf32-microblaze.c (ELF_TARGET_ID): Likewise.
* elf32-ppc.c (ELF_TARGET_ID): Likewise.
* elf32-s390.c (ELF_TARGET_ID): Likewise.
* elf32-sh.c (ELF_TARGET_ID): Likewise.
* elf32-sparc.c (ELF_TARGET_ID): Likewise.
* elf32-spu.c (ELF_TARGET_ID): Likewise.
* elf32-tic6x.c (ELF_TARGET_ID): Likewise.
* elf32-xtensa.c (ELF_TARGET_ID): Likewise.
* elf64-alpha.c (ELF_TARGET_ID): Likewise.
* elf64-hppa.c (ELF_TARGET_ID): Likewise.
* elf64-ppc.c (ELF_TARGET_ID): Likewise.
* elf64-s390.c (ELF_TARGET_ID): Likewise.
* elf64-x86-64.c (ELF_TARGET_ID): Likewise.
* elfxx-ia64.c (ELF_TARGET_ID): Likewise.

* elf32-hppa.c (elf32_hppa_mkobject): Removed.
(bfd_elf32_mkobject): Likewise.
(ELF_TARGET_ID): New.

* elf32-mips.c (ELF_TARGET_ID): New.
(bfd_elf32_mkobject): Removed.

* elf64-mips.c (ELF_TARGET_ID): New.
(bfd_elf64_mkobject): Removed.

* elfn32-mips.c (ELF_TARGET_ID): New.
(bfd_elf32_mkobject): Removed.

* elfxx-mips.c (_bfd_mips_elf_mkobject): Removed.
* elfxx-mips.h (_bfd_mips_elf_mkobject): Likewise.

* elfxx-target.h (bfd_elfNN_mkobject): Default to
bfd_elf_make_object.
(ELF_TARGET_ID): New.  Default to GENERIC_ELF_DATA.
(elfNN_bed): Initialize target_id.

36 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf-m10300.c
bfd/elf.c
bfd/elf32-arm.c
bfd/elf32-avr.c
bfd/elf32-bfin.c
bfd/elf32-cris.c
bfd/elf32-frv.c
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-lm32.c
bfd/elf32-m32r.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc12.c
bfd/elf32-m68k.c
bfd/elf32-microblaze.c
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-sparc.c
bfd/elf32-spu.c
bfd/elf32-tic6x.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-mips.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-x86-64.c
bfd/elfn32-mips.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-mips.h
bfd/elfxx-target.h

index dc696e72ccddb90488b08b5fce4892b2d0393b9c..31e4b4c186cfa5c150793967a756a940a862fa40 100644 (file)
@@ -1,3 +1,61 @@
+2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/11944
+       * elf-bfd.h (elf_backend_data): Add target_id.
+       (bfd_elf_make_generic_object): Renamed to ...
+       (bfd_elf_make_object): This.
+
+       * elf.c (bfd_elf_make_generic_object): Removed.
+       (bfd_elf_make_object): New.
+       (bfd_elf_mkcorefile): Really treat it as an object file.
+
+       * elf-m10300.c (ELF_TARGET_ID): New.
+       * elf32-arm.c (ELF_TARGET_ID): Likewise.
+       * elf32-bfin.c (ELF_TARGET_ID): Likewise.
+       * elf32-cris.c (ELF_TARGET_ID): Likewise.
+       * elf32-frv.c (ELF_TARGET_ID): Likewise.
+       * elf32-i386.c (ELF_TARGET_ID): Likewise.
+       * elf32-lm32.c (ELF_TARGET_ID): Likewise.
+       * elf32-m32r.c (ELF_TARGET_ID): Likewise.
+       * elf32-m68hc11.c (ELF_TARGET_ID): Likewise.
+       * elf32-m68hc12.c (ELF_TARGET_ID): Likewise.
+       * elf32-m68k.c (ELF_TARGET_ID): Likewise.
+       * elf32-microblaze.c (ELF_TARGET_ID): Likewise.
+       * elf32-ppc.c (ELF_TARGET_ID): Likewise.
+       * elf32-s390.c (ELF_TARGET_ID): Likewise.
+       * elf32-sh.c (ELF_TARGET_ID): Likewise.
+       * elf32-sparc.c (ELF_TARGET_ID): Likewise.
+       * elf32-spu.c (ELF_TARGET_ID): Likewise.
+       * elf32-tic6x.c (ELF_TARGET_ID): Likewise.
+       * elf32-xtensa.c (ELF_TARGET_ID): Likewise.
+       * elf64-alpha.c (ELF_TARGET_ID): Likewise.
+       * elf64-hppa.c (ELF_TARGET_ID): Likewise.
+       * elf64-ppc.c (ELF_TARGET_ID): Likewise.
+       * elf64-s390.c (ELF_TARGET_ID): Likewise.
+       * elf64-x86-64.c (ELF_TARGET_ID): Likewise.
+       * elfxx-ia64.c (ELF_TARGET_ID): Likewise.
+
+       * elf32-hppa.c (elf32_hppa_mkobject): Removed.
+       (bfd_elf32_mkobject): Likewise.
+       (ELF_TARGET_ID): New.
+
+       * elf32-mips.c (ELF_TARGET_ID): New.
+       (bfd_elf32_mkobject): Removed.
+
+       * elf64-mips.c (ELF_TARGET_ID): New.
+       (bfd_elf64_mkobject): Removed.
+
+       * elfn32-mips.c (ELF_TARGET_ID): New.
+       (bfd_elf32_mkobject): Removed.
+
+       * elfxx-mips.c (_bfd_mips_elf_mkobject): Removed.
+       * elfxx-mips.h (_bfd_mips_elf_mkobject): Likewise.
+
+       * elfxx-target.h (bfd_elfNN_mkobject): Default to
+       bfd_elf_make_object.
+       (ELF_TARGET_ID): New.  Default to GENERIC_ELF_DATA.
+       (elfNN_bed): Initialize target_id.
+
 2010-08-25  Julian Brown  <julian@codesourcery.com>
 
        * elf32-arm.c (arm_stub_required_alignment): New.
index 2220d4db5c22749fef0750df45cd33183ef2353c..dbcebd2c6bbf6eb5b1feab279f9f93583f3ee621 100644 (file)
@@ -689,6 +689,10 @@ struct elf_backend_data
   /* The architecture for this backend.  */
   enum bfd_architecture arch;
 
+  /* An identifier used to distinguish different target specific
+     extensions to elf_obj_tdata and elf_link_hash_table structures.  */
+  enum elf_target_id target_id;
+
   /* The ELF machine code (EM_xxxx) for this backend.  */
   int elf_machine_code;
 
@@ -1739,7 +1743,7 @@ extern bfd_reloc_status_type bfd_elf_generic_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
 extern bfd_boolean bfd_elf_allocate_object
   (bfd *, size_t, enum elf_target_id);
-extern bfd_boolean bfd_elf_make_generic_object
+extern bfd_boolean bfd_elf_make_object
   (bfd *);
 extern bfd_boolean bfd_elf_mkcorefile
   (bfd *);
index f151c21d278723de1e0e46d6d7e7b4e2b9d799c2..a4da9d52a62c6dec3f22092a1ca0806fec94d502 100644 (file)
@@ -4893,6 +4893,7 @@ _bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela)
 #define TARGET_LITTLE_SYM      bfd_elf32_mn10300_vec
 #define TARGET_LITTLE_NAME     "elf32-mn10300"
 #define ELF_ARCH               bfd_arch_mn10300
+#define ELF_TARGET_ID          MN10300_ELF_DATA
 #define ELF_MACHINE_CODE       EM_MN10300
 #define ELF_MACHINE_ALT1       EM_CYGNUS_MN10300
 #define ELF_MAXPAGESIZE                0x1000
index 9c56e2e7b1f7c4f0bacad9f32c715a526d70f574..f4e505876a48ded9de93a34da434689cad0245a6 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -250,17 +250,18 @@ bfd_elf_allocate_object (bfd *abfd,
 
 
 bfd_boolean
-bfd_elf_make_generic_object (bfd *abfd)
+bfd_elf_make_object (bfd *abfd)
 {
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   return bfd_elf_allocate_object (abfd, sizeof (struct elf_obj_tdata),
-                                 GENERIC_ELF_DATA);
+                                 bed->target_id);
 }
 
 bfd_boolean
 bfd_elf_mkcorefile (bfd *abfd)
 {
   /* I think this can be done just like an object file.  */
-  return bfd_elf_make_generic_object (abfd);
+  return abfd->xvec->_bfd_set_format[(int) bfd_object] (abfd);
 }
 
 static char *
index 390c0af0601882a0ffbdf79358b54bb25064933c..f81831995a3303fa03d7dd983684daf68dfe518c 100644 (file)
@@ -13900,6 +13900,7 @@ const struct elf_size_info elf32_arm_size_info =
 };
 
 #define ELF_ARCH                       bfd_arch_arm
+#define ELF_TARGET_ID                  ARM_ELF_DATA
 #define ELF_MACHINE_CODE               EM_ARM
 #ifdef __QNXTARGET__
 #define ELF_MAXPAGESIZE                        0x1000
index a9b41fab25fc14754d1a0d2cf2412a5278823409..7334340fd985fc3e08259432cbeeecbbdc8b8b05 100644 (file)
@@ -2991,6 +2991,7 @@ elf32_avr_build_stubs (struct bfd_link_info *info)
 }
 
 #define ELF_ARCH               bfd_arch_avr
+#define ELF_TARGET_ID          AVR_ELF_DATA
 #define ELF_MACHINE_CODE       EM_AVR
 #define ELF_MACHINE_ALT1       EM_AVR_OLD
 #define ELF_MAXPAGESIZE                1
index e8cdf22d868a905bcd8c1137a98ccadf795d30bf..ac41d63b3fa19e1b31fb640644ca7d142d108523 100644 (file)
@@ -5764,6 +5764,7 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
 #define TARGET_LITTLE_SYM              bfd_elf32_bfin_vec
 #define TARGET_LITTLE_NAME             "elf32-bfin"
 #define ELF_ARCH                       bfd_arch_bfin
+#define ELF_TARGET_ID                  BFIN_ELF_DATA
 #define ELF_MACHINE_CODE               EM_BLACKFIN
 #define ELF_MAXPAGESIZE                        0x1000
 #define elf_symbol_leading_char                '_'
index 0129d6a81486b1ffd38db8fe5bfa98fb544b3232..71634c93ebd6c9ad709cbef0dc4da1c0b6853ab6 100644 (file)
@@ -4364,6 +4364,7 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED,
 }
 \f
 #define ELF_ARCH               bfd_arch_cris
+#define ELF_TARGET_ID          CRIS_ELF_DATA
 #define ELF_MACHINE_CODE       EM_CRIS
 #define ELF_MAXPAGESIZE                0x2000
 
index 811d5f5b3ae41ccff1992a498872219a9eeaa9f5..2acc9173ce7b4b601da05d8ce08a37845f13ea7f 100644 (file)
@@ -6994,6 +6994,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
   return TRUE;
 }
 #define ELF_ARCH               bfd_arch_frv
+#define ELF_TARGET_ID          FRV_ELF_DATA
 #define ELF_MACHINE_CODE       EM_CYGNUS_FRV
 #define ELF_MAXPAGESIZE                0x1000
 
index 794de8282cad92214365a75fda392a1fd48721e0..1a6fef882732b1f8ded133e9037c1818f50a3c95 100644 (file)
@@ -336,15 +336,6 @@ struct elf32_hppa_link_hash_table
 #define eh_name(eh) \
   (eh ? eh->root.root.string : "<undef>")
 
-/* Override the generic function because we want to mark our BFDs.  */
-
-static bfd_boolean
-elf32_hppa_mkobject (bfd *abfd)
-{
-  return bfd_elf_allocate_object (abfd, sizeof (struct elf_obj_tdata),
-                                 HPPA32_ELF_DATA);
-}
-
 /* Assorted hash table functions.  */
 
 /* Initialize an entry in the stub hash table.  */
@@ -4649,7 +4640,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #define elf_info_to_howto_rel               elf_hppa_info_to_howto_rel
 
 /* Stuff for the BFD linker.  */
-#define bfd_elf32_mkobject                  elf32_hppa_mkobject
 #define bfd_elf32_bfd_final_link            elf32_hppa_final_link
 #define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create
 #define bfd_elf32_bfd_link_hash_table_free   elf32_hppa_link_hash_table_free
@@ -4687,6 +4677,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #define TARGET_BIG_SYM         bfd_elf32_hppa_vec
 #define TARGET_BIG_NAME                "elf32-hppa"
 #define ELF_ARCH               bfd_arch_hppa
+#define ELF_TARGET_ID          HPPA32_ELF_DATA
 #define ELF_MACHINE_CODE       EM_PARISC
 #define ELF_MAXPAGESIZE                0x1000
 #define ELF_OSABI              ELFOSABI_HPUX
index 581f218c8ca82fe4ea41705560e3875b4c2db0bf..7a426d51274efc4c62a5e0d360b64dc9f00710fa 100644 (file)
@@ -4692,6 +4692,7 @@ elf_i386_add_symbol_hook (bfd * abfd,
 #define TARGET_LITTLE_SYM              bfd_elf32_i386_vec
 #define TARGET_LITTLE_NAME             "elf32-i386"
 #define ELF_ARCH                       bfd_arch_i386
+#define ELF_TARGET_ID                  I386_ELF_DATA
 #define ELF_MACHINE_CODE               EM_386
 #define ELF_MAXPAGESIZE                        0x1000
 
index 727fc7a35692d46d185efd75c1d1cecf87eb1357..49b21307547a644155ccdcfdb77962cb4a3746a9 100644 (file)
@@ -2853,6 +2853,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
 
 
 #define ELF_ARCH                bfd_arch_lm32
+#define ELF_TARGET_ID          LM32_ELF_DATA
 #define ELF_MACHINE_CODE        EM_LATTICEMICO32
 #define ELF_MAXPAGESIZE         0x1000
 
index e079c4a1005c27f06b5e2782c27a4d38dae5c4f8..28eff7666ceaf4216cd81ad20e510f05c3071a97 100644 (file)
@@ -4080,6 +4080,7 @@ m32r_elf_reloc_type_class (const Elf_Internal_Rela *rela)
 }
 \f
 #define ELF_ARCH               bfd_arch_m32r
+#define ELF_TARGET_ID          M32R_ELF_DATA
 #define ELF_MACHINE_CODE       EM_M32R
 #define ELF_MACHINE_ALT1       EM_CYGNUS_M32R
 #define ELF_MAXPAGESIZE                0x1 /* Explicitly requested by Mitsubishi.  */
index 79a1944044445d80827df0aba7235f722285e966..63d0786bb60a2a3e7bc9db2562c2b62695830c6a 100644 (file)
@@ -1285,6 +1285,7 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] =
 };
 \f
 #define ELF_ARCH               bfd_arch_m68hc11
+#define ELF_TARGET_ID          M68HC11_ELF_DATA
 #define ELF_MACHINE_CODE       EM_68HC11
 #define ELF_MAXPAGESIZE                0x1000
 
index ba9293ba535c0b4e9b44c4cbd4a454f58630972b..1788856f8f516dd788b44d05d20190c688642971 100644 (file)
@@ -564,6 +564,7 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] =
 };
 \f
 #define ELF_ARCH               bfd_arch_m68hc12
+#define ELF_TARGET_ID          M68HC11_ELF_DATA
 #define ELF_MACHINE_CODE       EM_68HC12
 #define ELF_MAXPAGESIZE                0x1000
 
index 975207fb5def12421693ee2b2ca6e942575a2848..732361217613c2e294f72cd3e175d9d89faf0734 100644 (file)
@@ -469,6 +469,7 @@ reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup reloc_name_lookup
 #define ELF_ARCH bfd_arch_m68k
+#define ELF_TARGET_ID M68K_ELF_DATA
 \f
 /* Functions for the m68k ELF linker.  */
 
index e4c319d2d4de62c353f8ae243004b1c010a30070..a64926a51efa5bd94dc93c4b4c4dc6b2eca4a325 100644 (file)
@@ -3026,6 +3026,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
 #define TARGET_BIG_NAME                "elf32-microblaze"
 
 #define ELF_ARCH               bfd_arch_microblaze
+#define ELF_TARGET_ID          MICROBLAZE_ELF_DATA
 #define ELF_MACHINE_CODE       EM_MICROBLAZE
 #define ELF_MACHINE_ALT1       EM_MICROBLAZE_OLD
 #define ELF_MAXPAGESIZE                0x4             /* 4k, if we ever have 'em.  */
index aabf2847fedc968587064c4f0cb070adcd60c89f..aed0b4c974234920a35c814ac5d55aa2a36ab094 100644 (file)
@@ -1605,6 +1605,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 };
 \f
 #define ELF_ARCH                       bfd_arch_mips
+#define ELF_TARGET_ID                  MIPS_ELF_DATA
 #define ELF_MACHINE_CODE               EM_MIPS
 
 #define elf_backend_collect            TRUE
@@ -1676,7 +1677,6 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
 #define bfd_elf32_bfd_get_relocated_section_contents \
                                _bfd_elf_mips_get_relocated_section_contents
-#define bfd_elf32_mkobject             _bfd_mips_elf_mkobject
 #define bfd_elf32_bfd_link_hash_table_create \
                                        _bfd_mips_elf_link_hash_table_create
 #define bfd_elf32_bfd_final_link       _bfd_mips_elf_final_link
index eb8d5404e5f825074f992c2a4ba882ae8d3b1c3b..ef0e15927e9af4d3940e196abce5eec88bd39d00 100644 (file)
@@ -8927,6 +8927,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
 #define TARGET_BIG_SYM         bfd_elf32_powerpc_vec
 #define TARGET_BIG_NAME                "elf32-powerpc"
 #define ELF_ARCH               bfd_arch_powerpc
+#define ELF_TARGET_ID          PPC32_ELF_DATA
 #define ELF_MACHINE_CODE       EM_PPC
 #ifdef __QNXTARGET__
 #define ELF_MAXPAGESIZE                0x1000
index 4f9e0b336368cdb78768039feabd5046b9fa9dd8..bc8e054a841836169b8d5e220bc3c5dc935fa1e2 100644 (file)
@@ -3496,6 +3496,7 @@ elf32_s390_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 #define TARGET_BIG_SYM bfd_elf32_s390_vec
 #define TARGET_BIG_NAME        "elf32-s390"
 #define ELF_ARCH       bfd_arch_s390
+#define ELF_TARGET_ID  S390_ELF_DATA
 #define ELF_MACHINE_CODE EM_S390
 #define ELF_MACHINE_ALT1 EM_S390_OLD
 #define ELF_MAXPAGESIZE 0x1000
index e48017e13ae7f9db5a2a5f7efac8fe36513fac5b..023ed7ede7b475e87baf64a24cd8769a44c10079 100644 (file)
@@ -7569,6 +7569,7 @@ sh_elf_encode_eh_address (bfd *abfd,
 #endif
 
 #define ELF_ARCH               bfd_arch_sh
+#define ELF_TARGET_ID          SH_ELF_DATA
 #define ELF_MACHINE_CODE       EM_SH
 #ifdef __QNXTARGET__
 #define ELF_MAXPAGESIZE                0x1000
index 80102e9284f3ccb798dcad702f1e60f011d85023..adfe9247180de119697cd5fa4998ae9fd16b04a6 100644 (file)
@@ -188,6 +188,7 @@ elf32_sparc_add_symbol_hook (bfd * abfd,
 #define TARGET_BIG_SYM bfd_elf32_sparc_vec
 #define TARGET_BIG_NAME        "elf32-sparc"
 #define ELF_ARCH       bfd_arch_sparc
+#define ELF_TARGET_ID  SPARC_ELF_DATA
 #define ELF_MACHINE_CODE EM_SPARC
 #define ELF_MACHINE_ALT1 EM_SPARC32PLUS
 #define ELF_MAXPAGESIZE 0x10000
index fb3a4faa411509acf46c18f377fe45fe03b218b4..8615e468ef3224595754a281e81e1f1d1f845cdc 100644 (file)
@@ -5445,6 +5445,7 @@ spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info)
 #define TARGET_BIG_SYM         bfd_elf32_spu_vec
 #define TARGET_BIG_NAME                "elf32-spu"
 #define ELF_ARCH               bfd_arch_spu
+#define ELF_TARGET_ID          SPU_ELF_DATA
 #define ELF_MACHINE_CODE       EM_SPU
 /* This matches the alignment need for DMA.  */
 #define ELF_MAXPAGESIZE                0x80
index dc837fba2369ab37960f15abe7ddf39e14fe0944..3815ff1f2d62245c60c282bf2706de8a9e2d078f 100644 (file)
@@ -1753,6 +1753,7 @@ elf32_tic6x_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 #define TARGET_BIG_SYM         bfd_elf32_tic6x_be_vec
 #define TARGET_BIG_NAME                "elf32-tic6x-be"
 #define ELF_ARCH               bfd_arch_tic6x
+#define ELF_TARGET_ID          TIC6X_ELF_DATA
 #define ELF_MACHINE_CODE       EM_TI_C6000
 #define ELF_MAXPAGESIZE                1
 #define bfd_elf32_bfd_reloc_type_lookup elf32_tic6x_reloc_type_lookup
index 12788ec5fac7f339eb2b70b1267879dce724c6dd..9b9b5de06a8e730fe1a495639ac62f20658ec3e8 100644 (file)
@@ -10766,6 +10766,7 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] =
   { NULL,                       0,      0, 0,            0 }
 };
 \f
+#define ELF_TARGET_ID                  XTENSA_ELF_DATA
 #ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM              bfd_elf32_xtensa_le_vec
 #define TARGET_LITTLE_NAME             "elf32-xtensa-le"
index 083beb147270e95ece3016a0bee28b60fd7e0c9e..bd9a617de6d9bac6d7d6d1ac7a585cc639acfbf8 100644 (file)
@@ -5334,6 +5334,7 @@ static const struct elf_size_info alpha_elf_size_info =
 #define TARGET_LITTLE_SYM      bfd_elf64_alpha_vec
 #define TARGET_LITTLE_NAME     "elf64-alpha"
 #define ELF_ARCH               bfd_arch_alpha
+#define ELF_TARGET_ID          ALPHA_ELF_DATA
 #define ELF_MACHINE_CODE       EM_ALPHA
 #define ELF_MAXPAGESIZE        0x10000
 #define ELF_COMMONPAGESIZE     0x2000
index e76593db34f3b25bbc969ef6d7dc294a35f30c3c..ba6b1f84c7219c921c920b066ece7521e1474aa5 100644 (file)
@@ -4045,6 +4045,7 @@ const struct elf_size_info hppa64_elf_size_info =
 #define TARGET_BIG_SYM                 bfd_elf64_hppa_vec
 #define TARGET_BIG_NAME                        "elf64-hppa"
 #define ELF_ARCH                       bfd_arch_hppa
+#define ELF_TARGET_ID                  HPPA64_ELF_DATA
 #define ELF_MACHINE_CODE               EM_PARISC
 /* This is not strictly correct.  The maximum page size for PA2.0 is
    64M.  But everything still uses 4k.  */
index 33d7a87d105d7188087a740d26d46fa4ea55aead..bb079cf33e91157a34118052ec72a3475621411d 100644 (file)
@@ -3207,6 +3207,7 @@ const struct elf_size_info mips_elf64_size_info =
 };
 
 #define ELF_ARCH                       bfd_arch_mips
+#define ELF_TARGET_ID                  MIPS_ELF_DATA
 #define ELF_MACHINE_CODE               EM_MIPS
 
 #define elf_backend_collect            TRUE
@@ -3285,7 +3286,6 @@ const struct elf_size_info mips_elf64_size_info =
 #define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents
 #define bfd_elf64_bfd_get_relocated_section_contents \
                                _bfd_elf_mips_get_relocated_section_contents
-#define bfd_elf64_mkobject             _bfd_mips_elf_mkobject
 #define bfd_elf64_bfd_link_hash_table_create \
                                _bfd_mips_elf_link_hash_table_create
 #define bfd_elf64_bfd_final_link       _bfd_mips_elf_final_link
index 954d18df3a16eefdf12353203c0423f507ab9f4a..2073bdc11da94c62dbd7da3a7b4ca043b3c7e949 100644 (file)
@@ -61,6 +61,7 @@ static bfd_vma opd_entry_value
 #define TARGET_BIG_SYM         bfd_elf64_powerpc_vec
 #define TARGET_BIG_NAME                "elf64-powerpc"
 #define ELF_ARCH               bfd_arch_powerpc
+#define ELF_TARGET_ID          PPC64_ELF_DATA
 #define ELF_MACHINE_CODE       EM_PPC64
 #define ELF_MAXPAGESIZE                0x10000
 #define ELF_COMMONPAGESIZE     0x1000
index e994e4610616aea11b4e8115de9ef1637e01d7a4..2f253b93ed26cf79791dd5f3ca389949fafd561d 100644 (file)
@@ -3415,6 +3415,7 @@ const struct elf_size_info s390_elf64_size_info =
 #define TARGET_BIG_SYM bfd_elf64_s390_vec
 #define TARGET_BIG_NAME        "elf64-s390"
 #define ELF_ARCH       bfd_arch_s390
+#define ELF_TARGET_ID  S390_ELF_DATA
 #define ELF_MACHINE_CODE EM_S390
 #define ELF_MACHINE_ALT1 EM_S390_OLD
 #define ELF_MAXPAGESIZE 0x1000
index f11584b8a927695a3bb1e14a9cac3c187ec291e8..9da73a1f500063b85544ad8e1c4762223f3e0ecd 100644 (file)
@@ -4456,6 +4456,7 @@ static const struct bfd_elf_special_section
 #define TARGET_LITTLE_SYM                  bfd_elf64_x86_64_vec
 #define TARGET_LITTLE_NAME                 "elf64-x86-64"
 #define ELF_ARCH                           bfd_arch_i386
+#define ELF_TARGET_ID                      X86_64_ELF_DATA
 #define ELF_MACHINE_CODE                   EM_X86_64
 #define ELF_MAXPAGESIZE                            0x200000
 #define ELF_MINPAGESIZE                            0x1000
index 0aa25e7280828e8701336945b96e9951ed051717..8338bbb3814469beaf4735e782edaaecfb1bfe82 100644 (file)
@@ -2431,6 +2431,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 };
 \f
 #define ELF_ARCH                       bfd_arch_mips
+#define ELF_TARGET_ID                  MIPS_ELF_DATA
 #define ELF_MACHINE_CODE               EM_MIPS
 
 #define elf_backend_collect            TRUE
@@ -2504,7 +2505,6 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
 #define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
 #define bfd_elf32_bfd_get_relocated_section_contents \
                                _bfd_elf_mips_get_relocated_section_contents
-#define bfd_elf32_mkobject             _bfd_mips_elf_mkobject
 #define bfd_elf32_bfd_link_hash_table_create \
                                        _bfd_mips_elf_link_hash_table_create
 #define bfd_elf32_bfd_final_link       _bfd_mips_elf_final_link
index 0646ed1a8fc94568eb937b25868c0cf1ee6beb67..c8588b97511f93600fb06da8387995269277aa39 100644 (file)
@@ -5996,6 +5996,7 @@ elfNN_vms_close_and_cleanup (bfd *abfd)
 #define TARGET_BIG_SYM                 bfd_elfNN_ia64_big_vec
 #define TARGET_BIG_NAME                        "elfNN-ia64-big"
 #define ELF_ARCH                       bfd_arch_ia64
+#define ELF_TARGET_ID                  IA64_ELF_DATA
 #define ELF_MACHINE_CODE               EM_IA_64
 #define ELF_MACHINE_ALT1               1999    /* EAS2.3 */
 #define ELF_MACHINE_ALT2               1998    /* EAS2.2 */
index e9a9c27e100eccb27e222984f6b24168d0e1abbe..78f96c19e46b4dd9ba4ea86b12b2c65c488bdacb 100644 (file)
@@ -11520,15 +11520,6 @@ error_return:
   return NULL;
 }
 \f
-/* Allocate ABFD's target-dependent data.  */
-
-bfd_boolean
-_bfd_mips_elf_mkobject (bfd *abfd)
-{
-  return bfd_elf_allocate_object (abfd, sizeof (struct elf_obj_tdata),
-                                 MIPS_ELF_DATA);
-}
-
 /* Create a MIPS ELF linker hash table.  */
 
 struct bfd_link_hash_table *
index 096bd132478aa51a00a2ee60107b016d80cb7777..85cbfb842c8e2ac91c71670cd1764ff0da43cdd8 100644 (file)
@@ -92,8 +92,6 @@ extern bfd_boolean _bfd_mips_elf_set_section_contents
 extern bfd_byte *_bfd_elf_mips_get_relocated_section_contents
   (bfd *, struct bfd_link_info *, struct bfd_link_order *,
    bfd_byte *, bfd_boolean, asymbol **);
-extern bfd_boolean _bfd_mips_elf_mkobject
-  (bfd *);
 extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
   (bfd *);
 extern struct bfd_link_hash_table *_bfd_mips_vxworks_link_hash_table_create
index ebce6a8f07a850ce70c9f8866b78a9ee7a82b932..00fd693ba71475a97baac068526ec57d9dbe11c4 100644 (file)
 #endif
 
 #ifndef bfd_elfNN_mkobject
-#define bfd_elfNN_mkobject bfd_elf_make_generic_object
+#define bfd_elfNN_mkobject bfd_elf_make_object
 #endif
 
 #ifndef bfd_elfNN_mkcorefile
 #define elf_info_to_howto_rel 0
 #endif
 
+#ifndef ELF_TARGET_ID
+#define ELF_TARGET_ID  GENERIC_ELF_DATA
+#endif
+
 #ifndef ELF_OSABI
 #define ELF_OSABI ELFOSABI_NONE
 #endif
@@ -638,6 +642,7 @@ extern const struct elf_size_info _bfd_elfNN_size_info;
 static struct elf_backend_data elfNN_bed =
 {
   ELF_ARCH,                    /* arch */
+  ELF_TARGET_ID,               /* target_id */
   ELF_MACHINE_CODE,            /* elf_machine_code */
   ELF_OSABI,                   /* elf_osabi  */
   ELF_MAXPAGESIZE,             /* maxpagesize */