]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove _bfd_elf_link_hash_table_init target_id param
authorAlan Modra <amodra@gmail.com>
Wed, 18 Dec 2024 08:09:34 +0000 (18:39 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Dec 2024 21:36:37 +0000 (08:06 +1030)
hash_table_id can be set from elf_backend_data, now that all targets
have matching ELF_TARGET_ID and hash_table_init target_id.

44 files changed:
bfd/elf-bfd.h
bfd/elf-m10300.c
bfd/elf32-arc.c
bfd/elf32-arm.c
bfd/elf32-avr.c
bfd/elf32-bfin.c
bfd/elf32-cr16.c
bfd/elf32-cris.c
bfd/elf32-csky.c
bfd/elf32-frv.c
bfd/elf32-hppa.c
bfd/elf32-lm32.c
bfd/elf32-m32r.c
bfd/elf32-m68hc1x.c
bfd/elf32-m68k.c
bfd/elf32-metag.c
bfd/elf32-microblaze.c
bfd/elf32-nds32.c
bfd/elf32-or1k.c
bfd/elf32-ppc.c
bfd/elf32-pru.c
bfd/elf32-s390.c
bfd/elf32-score.c
bfd/elf32-sh.c
bfd/elf32-spu.c
bfd/elf32-tic6x.c
bfd/elf32-tilepro.c
bfd/elf32-vax.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-ia64-vms.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elflink.c
bfd/elfnn-aarch64.c
bfd/elfnn-ia64.c
bfd/elfnn-kvx.c
bfd/elfnn-loongarch.c
bfd/elfnn-riscv.c
bfd/elfxx-mips.c
bfd/elfxx-sparc.c
bfd/elfxx-tilegx.c
bfd/elfxx-x86.c

index 2f11bc2d2e68b0919d1d79d0c673385bb900b687..3048d63954d6749f8226d1c1a5c00e3ba38f5b0b 100644 (file)
@@ -2344,7 +2344,7 @@ extern bool _bfd_elf_link_hash_table_init
   (struct elf_link_hash_table *, bfd *,
    struct bfd_hash_entry *(*)
      (struct bfd_hash_entry *, struct bfd_hash_table *, const char *),
-   unsigned int, enum elf_target_id);
+   unsigned int);
 extern bool _bfd_elf_slurp_version_tables
   (bfd *, bool);
 extern bool _bfd_elf_merge_sections
index aa387fc413098b60467d579e970dfd76ee264644..b412a0c31fef4d5faa9e5311efc3d6d1e1726c79 100644 (file)
@@ -4618,8 +4618,7 @@ elf32_mn10300_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->static_hash_table->root, abfd,
                                      elf32_mn10300_link_hash_newfunc,
-                                     sizeof (struct elf32_mn10300_link_hash_entry),
-                                     MN10300_ELF_DATA))
+                                     sizeof (struct elf32_mn10300_link_hash_entry)))
     {
       free (ret->static_hash_table);
       free (ret);
@@ -4630,8 +4629,7 @@ elf32_mn10300_link_hash_table_create (bfd *abfd)
   abfd->link.hash = NULL;
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      elf32_mn10300_link_hash_newfunc,
-                                     sizeof (struct elf32_mn10300_link_hash_entry),
-                                     MN10300_ELF_DATA))
+                                     sizeof (struct elf32_mn10300_link_hash_entry)))
     {
       abfd->is_linker_output = true;
       abfd->link.hash = &ret->static_hash_table->root.root;
index bd182996654ce4df8b2c1c925198fc1d4a04c7bc..d151f0477240a8be37cc341c74665c11095f4349 100644 (file)
@@ -363,8 +363,7 @@ arc_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      elf_arc_link_hash_newfunc,
-                                     sizeof (struct elf_arc_link_hash_entry),
-                                     ARC_ELF_DATA))
+                                     sizeof (struct elf_arc_link_hash_entry)))
     {
       free (ret);
       return NULL;
index a4c23216c68627de04fd5ceb584e4f0ebf4abef3..74090d4829c0baedf12ee56e1b09b9faa08b49d5 100644 (file)
@@ -4102,8 +4102,7 @@ elf32_arm_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (& ret->root, abfd,
                                      elf32_arm_link_hash_newfunc,
-                                     sizeof (struct elf32_arm_link_hash_entry),
-                                     ARM_ELF_DATA))
+                                     sizeof (struct elf32_arm_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 12b68ba63f39fb055761c8f3c7332f810ef399bc..12c9c109711e73d6068676716dda1b0df9611bfb 100644 (file)
@@ -877,8 +877,7 @@ elf32_avr_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd,
                                      elf32_avr_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     AVR_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (htab);
       return NULL;
index f0e650d7e6078bb53b75b0da96f207dd9369dbdf..ba605e8afa0caa9df1170f0f23d3fc69910f59dd 100644 (file)
@@ -1742,8 +1742,7 @@ bfinfdpic_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     BFIN_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
@@ -4837,8 +4836,7 @@ bfin_link_hash_table_create (bfd * abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (ret, abfd, bfin_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     BFIN_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index f622fc708fb70c7dc40d13065004152d9fe4b221..26200e6bcfb001836674fbb244762d1e42c6c3a2 100644 (file)
@@ -1617,8 +1617,7 @@ elf32_cr16_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (ret, abfd,
                                      elf32_cr16_link_hash_newfunc,
-                                     sizeof (struct elf32_cr16_link_hash_entry),
-                                     GENERIC_ELF_DATA))
+                                     sizeof (struct elf32_cr16_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 8b10dae21b320f4a19575b4cb3b28c4ff14c1d35..9e5caac08dc83829995ee47cc58532581796c799 100644 (file)
@@ -898,8 +898,7 @@ elf_cris_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      elf_cris_link_hash_newfunc,
-                                     sizeof (struct elf_cris_link_hash_entry),
-                                     CRIS_ELF_DATA))
+                                     sizeof (struct elf_cris_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 0911a3fd451f0932607d6bf2c91eca6d40660162..0bdb37ff4e615c14582523c26e05035f46a96455 100644 (file)
@@ -1502,8 +1502,7 @@ csky_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      csky_elf_link_hash_newfunc,
-                                     sizeof (struct csky_elf_link_hash_entry),
-                                     CSKY_ELF_DATA))
+                                     sizeof (struct csky_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 718b7da8d68597480eb701ff3a000f0bfb76a2cf..d771213ae4247281e489331f767a9b58dff2fcb3 100644 (file)
@@ -951,8 +951,7 @@ frvfdpic_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     FRV_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 4d004323e63c7312f1f48389437ba33832dfee39..38f95695d5df577ecd691b1a83674b606dd55214 100644 (file)
@@ -418,8 +418,7 @@ elf32_hppa_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd, hppa_link_hash_newfunc,
-                                     sizeof (struct elf32_hppa_link_hash_entry),
-                                     HPPA32_ELF_DATA))
+                                     sizeof (struct elf32_hppa_link_hash_entry)))
     {
       free (htab);
       return NULL;
index e62e5fd1d46ef740b219bc2761f1e3d210afe1b9..d2dfa5b54f791d10a9f483a1d62d45d8a2c79ad4 100644 (file)
@@ -98,8 +98,7 @@ lm32_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     LM32_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index a02645a8358decb59dbc5e5a8234e083becc7625..99f4b779c6be2cc4aba9435c7280d8b80642f678 100644 (file)
@@ -1517,8 +1517,7 @@ m32r_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (ret, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     M32R_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 6ac21f496ba8f95b5dfd05f2e0b3859fddc4d7c1..87a3f828a70532cc55695bc3cba4f5ddf7b582ea 100644 (file)
@@ -84,8 +84,7 @@ m68hc11_elf_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     M68HC11_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 6355ae92a3c088b95f0848ee01c01e658ad5549d..58583d627e5f2db0589efaba98bdc5cbb617e72a 100644 (file)
@@ -977,8 +977,7 @@ elf_m68k_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      elf_m68k_link_hash_newfunc,
-                                     sizeof (struct elf_m68k_link_hash_entry),
-                                     M68K_ELF_DATA))
+                                     sizeof (struct elf_m68k_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 2821be43c44b1c72a4f3bc0140c119378aaaf6fd..1141c7cc5d1738057a5a3da2ac5948cdcceb9459 100644 (file)
@@ -1022,8 +1022,7 @@ elf_metag_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd,
                                      metag_link_hash_newfunc,
-                                     sizeof (struct elf_metag_link_hash_entry),
-                                     METAG_ELF_DATA))
+                                     sizeof (struct elf_metag_link_hash_entry)))
     {
       free (htab);
       return NULL;
index b500242c9cf0d594fb36ffcb379101cbdc6e7532..df1241426ae4e9594c6c33a684e9ad7c5b2652d5 100644 (file)
@@ -857,8 +857,7 @@ microblaze_elf_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct elf32_mb_link_hash_entry),
-                                     MICROBLAZE_ELF_DATA))
+                                     sizeof (struct elf32_mb_link_hash_entry)))
     {
       free (ret);
       return NULL;
index eb3e241acacfe7c067e2e7305f2f7dc9a80330de..def09db7bbe829038605245ff70a0c3c667a8f37 100644 (file)
@@ -3738,8 +3738,7 @@ nds32_elf_link_hash_table_create (bfd *abfd)
   /* Patch tag.  */
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      nds32_elf_link_hash_newfunc,
-                                     sizeof (struct elf_nds32_link_hash_entry),
-                                     NDS32_ELF_DATA))
+                                     sizeof (struct elf_nds32_link_hash_entry)))
     {
       free (ret);
       return NULL;
index f6c922016f72eb761b479063526a6d54ab84989e..1680e42d7575863024cd4f64d114eaed0d41a67c 100644 (file)
@@ -1028,8 +1028,7 @@ or1k_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      or1k_elf_link_hash_newfunc,
-                                     sizeof (struct elf_or1k_link_hash_entry),
-                                     OR1K_ELF_DATA))
+                                     sizeof (struct elf_or1k_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 8c89ae1611fb3e3e1ce94bb0081575b2e1553c21..9b625549a9c6af7c2375cc1eb476e9b33ff7bb87 100644 (file)
@@ -2279,8 +2279,7 @@ ppc_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      ppc_elf_link_hash_newfunc,
-                                     sizeof (struct ppc_elf_link_hash_entry),
-                                     PPC32_ELF_DATA))
+                                     sizeof (struct ppc_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index e76b483b526424f1b73db72fa393265e26bcfaed..e51e8b61069c655e0a78f52373f935910e84e5a8 100644 (file)
@@ -1559,11 +1559,8 @@ pru_elf32_link_hash_table_create (bfd *abfd)
   if (ret == NULL)
     return NULL;
 
-  if (!_bfd_elf_link_hash_table_init (ret, abfd,
-                                     link_hash_newfunc,
-                                     sizeof (struct
-                                             elf_link_hash_entry),
-                                     PRU_ELF_DATA))
+  if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc,
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 702b0239dd556d1d897c2e4c0ad0c2f9d7054a0f..565ce1f4f88f0d15e6dc5a89129b5511c6a7e515 100644 (file)
@@ -804,8 +804,7 @@ elf_s390_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct elf_s390_link_hash_entry),
-                                     S390_ELF_DATA))
+                                     sizeof (struct elf_s390_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 76e8761cf9042bd9fb86f7dffb8bff2d2672408e..34fc5dff7f1771e7ad44a37e3844206dbdc10c5e 100644 (file)
@@ -4364,8 +4364,7 @@ elf32_score_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (ret, abfd, score_elf_link_hash_newfunc,
-                                     sizeof (struct score_elf_link_hash_entry),
-                                     SCORE_ELF_DATA))
+                                     sizeof (struct score_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index ecb46bb616fd8f8a25e2ce80630a7274c52f70eb..18d803dcddad2a06ea7526dbceeaa1cc73377e88 100644 (file)
@@ -2244,8 +2244,7 @@ sh_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      sh_elf_link_hash_newfunc,
-                                     sizeof (struct elf_sh_link_hash_entry),
-                                     SH_ELF_DATA))
+                                     sizeof (struct elf_sh_link_hash_entry)))
     {
       free (ret);
       return NULL;
index f65a0081202c4d06dbb4b7a7eb514764235a2ffd..fbf5331130e5652d7ce775d0d7dacaf4a63d0cb3 100644 (file)
@@ -458,8 +458,7 @@ spu_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&htab->elf, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     SPU_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (htab);
       return NULL;
index dee75276d664dbbd34242ad398a1657aeaa2d81e..e8d04b0e35ca88c661db6c3d8153f5c70b176569 100644 (file)
@@ -1563,8 +1563,7 @@ elf32_tic6x_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      _bfd_elf_link_hash_newfunc,
-                                     sizeof (struct elf_link_hash_entry),
-                                     TIC6X_ELF_DATA))
+                                     sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 0c187c07832a8416354e38ca4ba297d24e5ba36f..eabb45689b3a0e6b338e85b6c0e3a5ff7eb745ab 100644 (file)
@@ -1184,8 +1184,7 @@ tilepro_elf_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc,
-                                     sizeof (struct tilepro_elf_link_hash_entry),
-                                     TILEPRO_ELF_DATA))
+                                     sizeof (struct tilepro_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 5107a4aa34e790cce8f79c1d820e63d39cba866f..5d534f8464f90eeb8ec5fb774850ade6cd9b28e7 100644 (file)
@@ -476,8 +476,7 @@ elf_vax_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (ret, abfd,
                                      elf_vax_link_hash_newfunc,
-                                     sizeof (struct elf_vax_link_hash_entry),
-                                     GENERIC_ELF_DATA))
+                                     sizeof (struct elf_vax_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 9682438f76ac95432505c10db4a3b42951e078ec..607b64c332207d9d2fba05732e5074984d6398f7 100644 (file)
@@ -741,8 +741,7 @@ elf_xtensa_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      elf_xtensa_link_hash_newfunc,
-                                     sizeof (struct elf_xtensa_link_hash_entry),
-                                     XTENSA_ELF_DATA))
+                                     sizeof (struct elf_xtensa_link_hash_entry)))
     {
       free (ret);
       return NULL;
index a29913d9365b182d87acf4c68ff49e0fc0462fad..f1ec344151a71d9c9bb8fae6038a0182efcea2db 100644 (file)
@@ -289,8 +289,7 @@ elf64_alpha_bfd_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      elf64_alpha_link_hash_newfunc,
-                                     sizeof (struct alpha_elf_link_hash_entry),
-                                     ALPHA_ELF_DATA))
+                                     sizeof (struct alpha_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 2d08bf3715574dfdccc68b66e4134bc45c65bf7e..f060cd05bd27417cd64bd30ebf555a09effde2e7 100644 (file)
@@ -296,8 +296,7 @@ elf64_hppa_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&htab->root, abfd,
                                      hppa64_link_hash_newfunc,
-                                     sizeof (struct elf64_hppa_link_hash_entry),
-                                     HPPA64_ELF_DATA))
+                                     sizeof (struct elf64_hppa_link_hash_entry)))
     {
       free (htab);
       return NULL;
index ea778deeb2aff8e7c7c835ee68c16ba63d10e2e0..5abea382a9552f785902f4c874460f47f524b82f 100644 (file)
@@ -1062,8 +1062,7 @@ elf64_ia64_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      elf64_ia64_new_elf_hash_entry,
-                                     sizeof (struct elf64_ia64_link_hash_entry),
-                                     IA64_ELF_DATA))
+                                     sizeof (struct elf64_ia64_link_hash_entry)))
     {
       free (ret);
       return NULL;
index f9964fa93d093ad63227037cc07620aee798ebac..31f25d2c6bcdfb82284c067d41a478ab1e71db02 100644 (file)
@@ -3547,8 +3547,7 @@ ppc64_elf_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&htab->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct ppc_link_hash_entry),
-                                     PPC64_ELF_DATA))
+                                     sizeof (struct ppc_link_hash_entry)))
     {
       free (htab);
       return NULL;
index f9d9902651bfe6e4905abd48074d66f79100843c..db7ca270a2896c085a5c80a840d068855d3de87c 100644 (file)
@@ -723,8 +723,7 @@ elf_s390_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct elf_s390_link_hash_entry),
-                                     S390_ELF_DATA))
+                                     sizeof (struct elf_s390_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 2b9e8b9ea302855333f624de3879df7731ea0240..34048ebb03f8c9581746075c13f5ee4f0961064e 100644 (file)
@@ -8318,11 +8318,11 @@ _bfd_elf_link_hash_table_init
    struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
                                      struct bfd_hash_table *,
                                      const char *),
-   unsigned int entsize,
-   enum elf_target_id target_id)
+   unsigned int entsize)
 {
   bool ret;
-  int can_refcount = get_elf_backend_data (abfd)->can_refcount;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  int can_refcount = bed->can_refcount;
 
   table->init_got_refcount.refcount = can_refcount - 1;
   table->init_plt_refcount.refcount = can_refcount - 1;
@@ -8334,8 +8334,8 @@ _bfd_elf_link_hash_table_init
   ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc, entsize);
 
   table->root.type = bfd_link_elf_hash_table;
-  table->hash_table_id = target_id;
-  table->target_os = get_elf_backend_data (abfd)->target_os;
+  table->hash_table_id = bed->target_id;
+  table->target_os = bed->target_os;
 
   return ret;
 }
@@ -8353,8 +8353,7 @@ _bfd_elf_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (! _bfd_elf_link_hash_table_init (ret, abfd, _bfd_elf_link_hash_newfunc,
-                                      sizeof (struct elf_link_hash_entry),
-                                      get_elf_backend_data (abfd)->target_id))
+                                      sizeof (struct elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 61aabcafa9aca547bfeba3e33bad2bf71d33b261..85f375ac08534b3fad8926f9923ebf980170ae27 100644 (file)
@@ -2916,7 +2916,7 @@ elfNN_aarch64_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init
       (&ret->root, abfd, elfNN_aarch64_link_hash_newfunc,
-       sizeof (struct elf_aarch64_link_hash_entry), AARCH64_ELF_DATA))
+       sizeof (struct elf_aarch64_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 4dabaa792f6b65c0672836b38661050c1b7e8ad4..4244e275eacce3414d29fd98c8f59008720ffb47 100644 (file)
@@ -1460,8 +1460,7 @@ elfNN_ia64_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      elfNN_ia64_new_elf_hash_entry,
-                                     sizeof (struct elfNN_ia64_link_hash_entry),
-                                     IA64_ELF_DATA))
+                                     sizeof (struct elfNN_ia64_link_hash_entry)))
     {
       free (ret);
       return NULL;
index e7028dcee5da467a9926eb46e6ffb890eb3664ef..49e98e0ea86d1ae6b51b9fabcc66eb9bf0c20466 100644 (file)
@@ -641,7 +641,7 @@ elfNN_kvx_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init
       (&ret->root, abfd, elfNN_kvx_link_hash_newfunc,
-       sizeof (struct elf_kvx_link_hash_entry), KVX_ELF_DATA))
+       sizeof (struct elf_kvx_link_hash_entry)))
     {
       free (ret);
       return NULL;
index e3d39163d94ce393583bebec5d90716db21ce2ff..d07813c0c885ac89e158aed6d88b0d3abef4e1c3 100644 (file)
@@ -490,7 +490,7 @@ loongarch_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init
       (&ret->elf, abfd, link_hash_newfunc,
-       sizeof (struct loongarch_elf_link_hash_entry), LARCH_ELF_DATA))
+       sizeof (struct loongarch_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 8bbdd15d5522fc8505182cd3d12a02f786f2b996..b120fc6070f9265d9d933418c66f5d8166fc7b79 100644 (file)
@@ -503,8 +503,7 @@ riscv_elf_link_hash_table_create (bfd *abfd)
     return NULL;
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct riscv_elf_link_hash_entry),
-                                     RISCV_ELF_DATA))
+                                     sizeof (struct riscv_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 459c98e23d7911215af904a3ffd2a7799f6500af..f85576337d4cb2706ce49f41acd12b157c5c3062 100644 (file)
@@ -14444,8 +14444,7 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
 
   if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
                                      mips_elf_link_hash_newfunc,
-                                     sizeof (struct mips_elf_link_hash_entry),
-                                     MIPS_ELF_DATA))
+                                     sizeof (struct mips_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 3f642aefd636e4b7c6493d1e7aee413f5bdbdb9a..344d10d4aeccd04475c38904e5e56b2c413b9d3d 100644 (file)
@@ -1178,8 +1178,7 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd)
     }
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct _bfd_sparc_elf_link_hash_entry),
-                                     SPARC_ELF_DATA))
+                                     sizeof (struct _bfd_sparc_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index c829792b25349a5ed513a7f4720bbc74b64922e9..31e9398018c3d7902414e10997a8e606a1b63cf7 100644 (file)
@@ -1399,8 +1399,7 @@ tilegx_elf_link_hash_table_create (bfd *abfd)
     }
 
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
-                                     sizeof (struct tilegx_elf_link_hash_entry),
-                                     TILEGX_ELF_DATA))
+                                     sizeof (struct tilegx_elf_link_hash_entry)))
     {
       free (ret);
       return NULL;
index 0843803171b018df1e9f33d285ec5d1b7cdf2790..fb223a5e9213c7ce8eefed480d0362e6f690c1db 100644 (file)
@@ -720,23 +720,21 @@ struct bfd_link_hash_table *
 _bfd_x86_elf_link_hash_table_create (bfd *abfd)
 {
   struct elf_x86_link_hash_table *ret;
-  const struct elf_backend_data *bed;
   size_t amt = sizeof (struct elf_x86_link_hash_table);
 
   ret = (struct elf_x86_link_hash_table *) bfd_zmalloc (amt);
   if (ret == NULL)
     return NULL;
 
-  bed = get_elf_backend_data (abfd);
   if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
                                      _bfd_x86_elf_link_hash_newfunc,
-                                     sizeof (struct elf_x86_link_hash_entry),
-                                     bed->target_id))
+                                     sizeof (struct elf_x86_link_hash_entry)))
     {
       free (ret);
       return NULL;
     }
 
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   if (bed->target_id == X86_64_ELF_DATA)
     {
       ret->is_reloc_section = elf_x86_64_is_reloc_section;