2e9b04
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35/bfd/elf-bfd.h
2e9b04
--- binutils.orig/bfd/elf-bfd.h	2020-07-30 15:04:05.366466702 +0100
2e9b04
+++ binutils-2.35/bfd/elf-bfd.h	2020-07-30 15:04:16.707393960 +0100
2e9b04
@@ -549,6 +549,16 @@ enum elf_target_os
2e9b04
   is_nacl	/* Native Client.  */
2e9b04
 };
2e9b04
 
2e9b04
+/* Used by bfd_sym_from_r_symndx to cache a small number of local
2e9b04
+   symbols.  */
2e9b04
+#define LOCAL_SYM_CACHE_SIZE 32
2e9b04
+struct sym_cache
2e9b04
+{
2e9b04
+  bfd *abfd;
2e9b04
+  unsigned long indx[LOCAL_SYM_CACHE_SIZE];
2e9b04
+  Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
2e9b04
+};
2e9b04
+
2e9b04
 /* ELF linker hash table.  */
2e9b04
 
2e9b04
 struct elf_link_hash_table
2e9b04
@@ -676,6 +686,9 @@ struct elf_link_hash_table
2e9b04
   /* A linked list of dynamic BFD's loaded in the link.  */
2e9b04
   struct elf_link_loaded_list *dyn_loaded;
2e9b04
 
2e9b04
+  /* Small local sym cache.  */
2e9b04
+  struct sym_cache sym_cache;
2e9b04
+
2e9b04
   /* Short-cuts to get to dynamic linker sections.  */
2e9b04
   asection *sgot;
2e9b04
   asection *sgotplt;
2e9b04
@@ -717,16 +730,6 @@ struct elf_link_hash_table
2e9b04
 /* Returns TRUE if the hash table is a struct elf_link_hash_table.  */
2e9b04
 #define is_elf_hash_table(htab)						\
2e9b04
   (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table)
2e9b04
-
2e9b04
-/* Used by bfd_sym_from_r_symndx to cache a small number of local
2e9b04
-   symbols.  */
2e9b04
-#define LOCAL_SYM_CACHE_SIZE 32
2e9b04
-struct sym_cache
2e9b04
-{
2e9b04
-  bfd *abfd;
2e9b04
-  unsigned long indx[LOCAL_SYM_CACHE_SIZE];
2e9b04
-  Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
2e9b04
-};
2e9b04
 
2e9b04
 /* Constant information held for an ELF backend.  */
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elf32-arm.c binutils-2.35/bfd/elf32-arm.c
2e9b04
--- binutils.orig/bfd/elf32-arm.c	2020-07-30 15:04:05.376466638 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-arm.c	2020-07-30 15:04:16.708393953 +0100
2e9b04
@@ -3390,9 +3390,6 @@ struct elf32_arm_link_hash_table
2e9b04
     bfd_vma offset;
2e9b04
   } tls_ldm_got;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* For convenience in allocate_dynrelocs.  */
2e9b04
   bfd * obfd;
2e9b04
 
2e9b04
@@ -15316,7 +15313,7 @@ elf32_arm_check_relocs (bfd *abfd, struc
2e9b04
 	  if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	    {
2e9b04
 	      /* A local symbol.  */
2e9b04
-	      isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	      isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
 					    abfd, r_symndx);
2e9b04
 	      if (isym == NULL)
2e9b04
 		return FALSE;
2e9b04
@@ -16871,7 +16868,8 @@ elf32_arm_size_dynamic_sections (bfd * o
2e9b04
 		  s->size += 4;
2e9b04
 		}
2e9b04
 
2e9b04
-	      isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, symndx);
2e9b04
+	      isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ibfd,
2e9b04
+					    symndx);
2e9b04
 	      if (isym == NULL)
2e9b04
 		return FALSE;
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elf32-bfin.c binutils-2.35/bfd/elf32-bfin.c
2e9b04
--- binutils.orig/bfd/elf32-bfin.c	2020-07-30 15:04:05.377466632 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-bfin.c	2020-07-30 15:04:16.709393947 +0100
2e9b04
@@ -4791,16 +4791,6 @@ struct bfin_link_hash_entry
2e9b04
   struct bfin_pcrel_relocs_copied *pcrel_relocs_copied;
2e9b04
 };
2e9b04
 
2e9b04
-/* bfin ELF linker hash table.  */
2e9b04
-
2e9b04
-struct bfin_link_hash_table
2e9b04
-{
2e9b04
-  struct elf_link_hash_table root;
2e9b04
-
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-};
2e9b04
-
2e9b04
 #define bfin_hash_entry(ent) ((struct bfin_link_hash_entry *) (ent))
2e9b04
 
2e9b04
 static struct bfd_hash_entry *
2e9b04
@@ -4829,15 +4819,14 @@ bfin_link_hash_newfunc (struct bfd_hash_
2e9b04
 static struct bfd_link_hash_table *
2e9b04
 bfin_link_hash_table_create (bfd * abfd)
2e9b04
 {
2e9b04
-  struct bfin_link_hash_table *ret;
2e9b04
-  size_t amt = sizeof (struct bfin_link_hash_table);
2e9b04
+  struct elf_link_hash_table *ret;
2e9b04
+  size_t amt = sizeof (struct elf_link_hash_table);
2e9b04
 
2e9b04
   ret = bfd_zmalloc (amt);
2e9b04
   if (ret == NULL)
2e9b04
     return NULL;
2e9b04
 
2e9b04
-  if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
2e9b04
-				      bfin_link_hash_newfunc,
2e9b04
+  if (!_bfd_elf_link_hash_table_init (ret, abfd, bfin_link_hash_newfunc,
2e9b04
 				      sizeof (struct elf_link_hash_entry),
2e9b04
 				      BFIN_ELF_DATA))
2e9b04
     {
2e9b04
@@ -4845,9 +4834,7 @@ bfin_link_hash_table_create (bfd * abfd)
2e9b04
       return NULL;
2e9b04
     }
2e9b04
 
2e9b04
-  ret->sym_cache.abfd = NULL;
2e9b04
-
2e9b04
-  return &ret->root.root;
2e9b04
+  return &ret->root;
2e9b04
 }
2e9b04
 
2e9b04
 /* The size in bytes of an entry in the procedure linkage table.  */
2e9b04
@@ -5418,10 +5405,6 @@ struct bfd_elf_special_section const elf
2e9b04
 
2e9b04
 #define bfd_elf32_bfd_is_local_label_name \
2e9b04
 					bfin_is_local_label_name
2e9b04
-#define bfin_hash_table(p) \
2e9b04
-  ((struct bfin_link_hash_table *) (p)->hash)
2e9b04
-
2e9b04
-
2e9b04
 
2e9b04
 #define elf_backend_create_dynamic_sections \
2e9b04
 					_bfd_elf_create_dynamic_sections
2e9b04
diff -rup binutils.orig/bfd/elf32-csky.c binutils-2.35/bfd/elf32-csky.c
2e9b04
--- binutils.orig/bfd/elf32-csky.c	2020-07-30 15:04:05.378466625 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-csky.c	2020-07-30 15:04:16.709393947 +0100
2e9b04
@@ -1208,9 +1208,6 @@ struct csky_elf_link_hash_table
2e9b04
 {
2e9b04
   struct elf_link_hash_table elf;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Data for R_CKCORE_TLS_LDM32 relocations.  */
2e9b04
   union
2e9b04
   {
2e9b04
@@ -2477,7 +2474,7 @@ csky_elf_check_relocs (bfd * abfd,
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
@@ -2584,7 +2581,7 @@ csky_elf_check_relocs (bfd * abfd,
2e9b04
 		  asection *s;
2e9b04
 		  Elf_Internal_Sym *loc_isym;
2e9b04
 
2e9b04
-		  loc_isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  loc_isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						    abfd, r_symndx);
2e9b04
 		  if (loc_isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-hppa.c binutils-2.35/bfd/elf32-hppa.c
2e9b04
--- binutils.orig/bfd/elf32-hppa.c	2020-07-30 15:04:05.368466689 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-hppa.c	2020-07-30 15:04:16.709393947 +0100
2e9b04
@@ -286,9 +286,6 @@ struct elf32_hppa_link_hash_table
2e9b04
   /* Set if we need a .plt stub to support lazy dynamic linking.  */
2e9b04
   unsigned int need_plt_stub:1;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Data for LDM relocations.  */
2e9b04
   union
2e9b04
   {
2e9b04
@@ -1465,7 +1462,7 @@ elf32_hppa_check_relocs (bfd *abfd,
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
@@ -4038,7 +4035,7 @@ elf32_hppa_relocate_section (bfd *output
2e9b04
 		else
2e9b04
 		  {
2e9b04
 		    Elf_Internal_Sym *isym
2e9b04
-		      = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		      = bfd_sym_from_r_symndx (&htab->etab.sym_cache,
2e9b04
 					       input_bfd, r_symndx);
2e9b04
 		    if (isym == NULL)
2e9b04
 		      return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.35/bfd/elf32-i386.c
2e9b04
--- binutils.orig/bfd/elf32-i386.c	2020-07-30 15:04:05.380466612 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-i386.c	2020-07-30 15:04:16.710393941 +0100
2e9b04
@@ -1158,7 +1158,7 @@ elf_i386_tls_transition (struct bfd_link
2e9b04
 	    {
2e9b04
 	      Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-	      isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	      isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					    abfd, r_symndx);
2e9b04
 	      name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
2e9b04
 	    }
2e9b04
@@ -1251,7 +1251,7 @@ elf_i386_convert_load_reloc (bfd *abfd,
2e9b04
   else
2e9b04
     {
2e9b04
       local_ref = TRUE;
2e9b04
-      isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd,
2e9b04
+      isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd,
2e9b04
 				    r_symndx);
2e9b04
       abs_symbol = isym->st_shndx == SHN_ABS;
2e9b04
     }
2e9b04
@@ -1529,7 +1529,7 @@ elf_i386_check_relocs (bfd *abfd,
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    goto error_return;
2e9b04
@@ -1859,7 +1859,7 @@ elf_i386_check_relocs (bfd *abfd,
2e9b04
 		  void **vpp;
2e9b04
 		  asection *s;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    goto error_return;
2e9b04
diff -rup binutils.orig/bfd/elf32-m32r.c binutils-2.35/bfd/elf32-m32r.c
2e9b04
--- binutils.orig/bfd/elf32-m32r.c	2020-07-30 15:04:05.370466676 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-m32r.c	2020-07-30 15:04:16.710393941 +0100
2e9b04
@@ -1498,20 +1498,6 @@ struct elf_m32r_pcrel_relocs_copied
2e9b04
   bfd_size_type count;
2e9b04
 };
2e9b04
 
2e9b04
-/* m32r ELF linker hash table.  */
2e9b04
-
2e9b04
-struct elf_m32r_link_hash_table
2e9b04
-{
2e9b04
-  struct elf_link_hash_table root;
2e9b04
-
2e9b04
-  /* Short-cuts to get to dynamic linker sections.  */
2e9b04
-  asection *sdynbss;
2e9b04
-  asection *srelbss;
2e9b04
-
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-};
2e9b04
-
2e9b04
 /* Traverse an m32r ELF linker hash table.  */
2e9b04
 
2e9b04
 #define m32r_elf_link_hash_traverse(table, func, info)			\
2e9b04
@@ -1524,21 +1510,21 @@ struct elf_m32r_link_hash_table
2e9b04
 
2e9b04
 #define m32r_elf_hash_table(p) \
2e9b04
   (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
2e9b04
-  == M32R_ELF_DATA ? ((struct elf_m32r_link_hash_table *) ((p)->hash)) : NULL)
2e9b04
+  == M32R_ELF_DATA ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL)
2e9b04
 
2e9b04
 /* Create an m32r ELF linker hash table.  */
2e9b04
 
2e9b04
 static struct bfd_link_hash_table *
2e9b04
 m32r_elf_link_hash_table_create (bfd *abfd)
2e9b04
 {
2e9b04
-  struct elf_m32r_link_hash_table *ret;
2e9b04
-  size_t amt = sizeof (struct elf_m32r_link_hash_table);
2e9b04
+  struct elf_link_hash_table *ret;
2e9b04
+  size_t amt = sizeof (struct elf_link_hash_table);
2e9b04
 
2e9b04
   ret = bfd_zmalloc (amt);
2e9b04
   if (ret == NULL)
2e9b04
     return NULL;
2e9b04
 
2e9b04
-  if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
2e9b04
+  if (!_bfd_elf_link_hash_table_init (ret, abfd,
2e9b04
 				      _bfd_elf_link_hash_newfunc,
2e9b04
 				      sizeof (struct elf_link_hash_entry),
2e9b04
 				      M32R_ELF_DATA))
2e9b04
@@ -1547,7 +1533,7 @@ m32r_elf_link_hash_table_create (bfd *ab
2e9b04
       return NULL;
2e9b04
     }
2e9b04
 
2e9b04
-  return &ret->root.root;
2e9b04
+  return &ret->root;
2e9b04
 }
2e9b04
 
2e9b04
 /* Create dynamic sections when linking against a dynamic object.  */
2e9b04
@@ -1555,7 +1541,7 @@ m32r_elf_link_hash_table_create (bfd *ab
2e9b04
 static bfd_boolean
2e9b04
 m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
2e9b04
 {
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   flagword flags, pltflags;
2e9b04
   asection *s;
2e9b04
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
2e9b04
@@ -1578,7 +1564,7 @@ m32r_elf_create_dynamic_sections (bfd *a
2e9b04
     pltflags |= SEC_READONLY;
2e9b04
 
2e9b04
   s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
2e9b04
-  htab->root.splt = s;
2e9b04
+  htab->splt = s;
2e9b04
   if (s == NULL
2e9b04
       || !bfd_set_section_alignment (s, bed->plt_alignment))
2e9b04
     return FALSE;
2e9b04
@@ -1598,7 +1584,7 @@ m32r_elf_create_dynamic_sections (bfd *a
2e9b04
       h = (struct elf_link_hash_entry *) bh;
2e9b04
       h->def_regular = 1;
2e9b04
       h->type = STT_OBJECT;
2e9b04
-      htab->root.hplt = h;
2e9b04
+      htab->hplt = h;
2e9b04
 
2e9b04
       if (bfd_link_pic (info)
2e9b04
 	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
2e9b04
@@ -1609,12 +1595,12 @@ m32r_elf_create_dynamic_sections (bfd *a
2e9b04
 					  bed->default_use_rela_p
2e9b04
 					  ? ".rela.plt" : ".rel.plt",
2e9b04
 					  flags | SEC_READONLY);
2e9b04
-  htab->root.srelplt = s;
2e9b04
+  htab->srelplt = s;
2e9b04
   if (s == NULL
2e9b04
       || !bfd_set_section_alignment (s, ptralign))
2e9b04
     return FALSE;
2e9b04
 
2e9b04
-  if (htab->root.sgot == NULL
2e9b04
+  if (htab->sgot == NULL
2e9b04
       && !_bfd_elf_create_got_section (abfd, info))
2e9b04
     return FALSE;
2e9b04
 
2e9b04
@@ -1669,7 +1655,7 @@ static bfd_boolean
2e9b04
 m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
2e9b04
 				struct elf_link_hash_entry *h)
2e9b04
 {
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   bfd *dynobj;
2e9b04
   asection *s;
2e9b04
 
2e9b04
@@ -1796,7 +1782,7 @@ static bfd_boolean
2e9b04
 allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
2e9b04
 {
2e9b04
   struct bfd_link_info *info;
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   struct elf_dyn_relocs *p;
2e9b04
 
2e9b04
   if (h->root.type == bfd_link_hash_indirect)
2e9b04
@@ -1807,7 +1793,7 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
   if (htab == NULL)
2e9b04
     return FALSE;
2e9b04
 
2e9b04
-  if (htab->root.dynamic_sections_created
2e9b04
+  if (htab->dynamic_sections_created
2e9b04
       && h->plt.refcount > 0)
2e9b04
     {
2e9b04
       /* Make sure this symbol is output as a dynamic symbol.
2e9b04
@@ -1821,7 +1807,7 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
 
2e9b04
       if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
2e9b04
 	{
2e9b04
-	  asection *s = htab->root.splt;
2e9b04
+	  asection *s = htab->splt;
2e9b04
 
2e9b04
 	  /* If this is the first .plt entry, make room for the special
2e9b04
 	     first entry.  */
2e9b04
@@ -1847,10 +1833,10 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
 
2e9b04
 	  /* We also need to make an entry in the .got.plt section, which
2e9b04
 	     will be placed in the .got section by the linker script.  */
2e9b04
-	  htab->root.sgotplt->size += 4;
2e9b04
+	  htab->sgotplt->size += 4;
2e9b04
 
2e9b04
 	  /* We also need to make an entry in the .rel.plt section.  */
2e9b04
-	  htab->root.srelplt->size += sizeof (Elf32_External_Rela);
2e9b04
+	  htab->srelplt->size += sizeof (Elf32_External_Rela);
2e9b04
 	}
2e9b04
       else
2e9b04
 	{
2e9b04
@@ -1878,13 +1864,13 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
 	    return FALSE;
2e9b04
 	}
2e9b04
 
2e9b04
-      s = htab->root.sgot;
2e9b04
+      s = htab->sgot;
2e9b04
 
2e9b04
       h->got.offset = s->size;
2e9b04
       s->size += 4;
2e9b04
-      dyn = htab->root.dynamic_sections_created;
2e9b04
+      dyn = htab->dynamic_sections_created;
2e9b04
       if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h))
2e9b04
-	htab->root.srelgot->size += sizeof (Elf32_External_Rela);
2e9b04
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
2e9b04
     }
2e9b04
   else
2e9b04
     h->got.offset = (bfd_vma) -1;
2e9b04
@@ -1944,7 +1930,7 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
       if (!h->non_got_ref
2e9b04
 	  && ((h->def_dynamic
2e9b04
 	       && !h->def_regular)
2e9b04
-	      || (htab->root.dynamic_sections_created
2e9b04
+	      || (htab->dynamic_sections_created
2e9b04
 		  && (h->root.type == bfd_link_hash_undefweak
2e9b04
 		      || h->root.type == bfd_link_hash_undefined))))
2e9b04
 	{
2e9b04
@@ -1984,7 +1970,7 @@ static bfd_boolean
2e9b04
 m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
2e9b04
 				struct bfd_link_info *info)
2e9b04
 {
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   bfd *dynobj;
2e9b04
   asection *s;
2e9b04
   bfd_boolean relocs;
2e9b04
@@ -1998,10 +1984,10 @@ m32r_elf_size_dynamic_sections (bfd *out
2e9b04
   if (htab == NULL)
2e9b04
     return FALSE;
2e9b04
 
2e9b04
-  dynobj = htab->root.dynobj;
2e9b04
+  dynobj = htab->dynobj;
2e9b04
   BFD_ASSERT (dynobj != NULL);
2e9b04
 
2e9b04
-  if (htab->root.dynamic_sections_created)
2e9b04
+  if (htab->dynamic_sections_created)
2e9b04
     {
2e9b04
       /* Set the contents of the .interp section to the interpreter.  */
2e9b04
       if (bfd_link_executable (info) && !info->nointerp)
2e9b04
@@ -2060,8 +2046,8 @@ m32r_elf_size_dynamic_sections (bfd *out
2e9b04
       symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
2e9b04
       locsymcount = symtab_hdr->sh_info;
2e9b04
       end_local_got = local_got + locsymcount;
2e9b04
-      s = htab->root.sgot;
2e9b04
-      srel = htab->root.srelgot;
2e9b04
+      s = htab->sgot;
2e9b04
+      srel = htab->srelgot;
2e9b04
       for (; local_got < end_local_got; ++local_got)
2e9b04
 	{
2e9b04
 	  if (*local_got > 0)
2e9b04
@@ -2078,7 +2064,7 @@ m32r_elf_size_dynamic_sections (bfd *out
2e9b04
 
2e9b04
   /* Allocate global sym .plt and .got entries, and space for global
2e9b04
      sym dynamic relocs.  */
2e9b04
-  elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info);
2e9b04
+  elf_link_hash_traverse (htab, allocate_dynrelocs, info);
2e9b04
 
2e9b04
   /* We now have determined the sizes of the various dynamic sections.
2e9b04
      Allocate memory for them.  */
2e9b04
@@ -2088,9 +2074,9 @@ m32r_elf_size_dynamic_sections (bfd *out
2e9b04
       if ((s->flags & SEC_LINKER_CREATED) == 0)
2e9b04
 	continue;
2e9b04
 
2e9b04
-      if (s == htab->root.splt
2e9b04
-	  || s == htab->root.sgot
2e9b04
-	  || s == htab->root.sgotplt
2e9b04
+      if (s == htab->splt
2e9b04
+	  || s == htab->sgot
2e9b04
+	  || s == htab->sgotplt
2e9b04
 	  || s == htab->sdynbss)
2e9b04
 	{
2e9b04
 	  /* Strip this section if we don't need it; see the
2e9b04
@@ -2098,7 +2084,7 @@ m32r_elf_size_dynamic_sections (bfd *out
2e9b04
 	}
2e9b04
       else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
2e9b04
 	{
2e9b04
-	  if (s->size != 0 && s != htab->root.srelplt)
2e9b04
+	  if (s->size != 0 && s != htab->srelplt)
2e9b04
 	    relocs = TRUE;
2e9b04
 
2e9b04
 	  /* We use the reloc_count field as a counter if we need
2e9b04
@@ -2188,7 +2174,7 @@ m32r_elf_relocate_section (bfd *output_b
2e9b04
   Elf_Internal_Rela *rel, *relend;
2e9b04
   /* Assume success.  */
2e9b04
   bfd_boolean ret = TRUE;
2e9b04
-  struct elf_m32r_link_hash_table *htab = m32r_elf_hash_table (info);
2e9b04
+  struct elf_link_hash_table *htab = m32r_elf_hash_table (info);
2e9b04
   bfd_vma *local_got_offsets;
2e9b04
   asection *sgot, *splt, *sreloc;
2e9b04
   bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section);
2e9b04
@@ -2198,8 +2184,8 @@ m32r_elf_relocate_section (bfd *output_b
2e9b04
 
2e9b04
   local_got_offsets = elf_local_got_offsets (input_bfd);
2e9b04
 
2e9b04
-  sgot = htab->root.sgot;
2e9b04
-  splt = htab->root.splt;
2e9b04
+  sgot = htab->sgot;
2e9b04
+  splt = htab->splt;
2e9b04
   sreloc = NULL;
2e9b04
 
2e9b04
   rel = relocs;
2e9b04
@@ -2295,7 +2281,7 @@ m32r_elf_relocate_section (bfd *output_b
2e9b04
 	      bfd_boolean dyn;
2e9b04
 	      sec = h->root.u.def.section;
2e9b04
 
2e9b04
-	      dyn = htab->root.dynamic_sections_created;
2e9b04
+	      dyn = htab->dynamic_sections_created;
2e9b04
 	      sec = h->root.u.def.section;
2e9b04
 	      if (r_type == R_M32R_GOTPC24
2e9b04
 		  || (r_type == R_M32R_GOTPC_HI_ULO
2e9b04
@@ -2516,7 +2502,7 @@ m32r_elf_relocate_section (bfd *output_b
2e9b04
 		  off = h->got.offset;
2e9b04
 		  BFD_ASSERT (off != (bfd_vma) -1);
2e9b04
 
2e9b04
-		  dyn = htab->root.dynamic_sections_created;
2e9b04
+		  dyn = htab->dynamic_sections_created;
2e9b04
 		  if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
2e9b04
 							 bfd_link_pic (info),
2e9b04
 							 h)
2e9b04
@@ -2576,7 +2562,7 @@ m32r_elf_relocate_section (bfd *output_b
2e9b04
 
2e9b04
 			  /* We need to generate a R_M32R_RELATIVE reloc
2e9b04
 			     for the dynamic linker.  */
2e9b04
-			  srelgot = htab->root.srelgot;
2e9b04
+			  srelgot = htab->srelgot;
2e9b04
 			  BFD_ASSERT (srelgot != NULL);
2e9b04
 
2e9b04
 			  outrel.r_offset = (sgot->output_section->vma
2e9b04
@@ -2892,7 +2878,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out
2e9b04
 				struct elf_link_hash_entry *h,
2e9b04
 				Elf_Internal_Sym *sym)
2e9b04
 {
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   bfd_byte *loc;
2e9b04
 
2e9b04
 #ifdef DEBUG_PIC
2e9b04
@@ -2918,9 +2904,9 @@ m32r_elf_finish_dynamic_symbol (bfd *out
2e9b04
 
2e9b04
       BFD_ASSERT (h->dynindx != -1);
2e9b04
 
2e9b04
-      splt = htab->root.splt;
2e9b04
-      sgot = htab->root.sgotplt;
2e9b04
-      srela = htab->root.srelplt;
2e9b04
+      splt = htab->splt;
2e9b04
+      sgot = htab->sgotplt;
2e9b04
+      srela = htab->srelplt;
2e9b04
       BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
2e9b04
 
2e9b04
       /* Get the index in the procedure linkage table which
2e9b04
@@ -3014,8 +3000,8 @@ m32r_elf_finish_dynamic_symbol (bfd *out
2e9b04
       /* This symbol has an entry in the global offset table.  Set it
2e9b04
 	 up.  */
2e9b04
 
2e9b04
-      sgot = htab->root.sgot;
2e9b04
-      srela = htab->root.srelgot;
2e9b04
+      sgot = htab->sgot;
2e9b04
+      srela = htab->srelgot;
2e9b04
       BFD_ASSERT (sgot != NULL && srela != NULL);
2e9b04
 
2e9b04
       rela.r_offset = (sgot->output_section->vma
2e9b04
@@ -3063,7 +3049,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out
2e9b04
 		  && (h->root.type == bfd_link_hash_defined
2e9b04
 		      || h->root.type == bfd_link_hash_defweak));
2e9b04
 
2e9b04
-      s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss");
2e9b04
+      s = bfd_get_linker_section (htab->dynobj, ".rela.bss");
2e9b04
       BFD_ASSERT (s != NULL);
2e9b04
 
2e9b04
       rela.r_offset = (h->root.u.def.value
2e9b04
@@ -3078,7 +3064,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out
2e9b04
     }
2e9b04
 
2e9b04
   /* Mark some specially defined symbols as absolute.  */
2e9b04
-  if (h == htab->root.hdynamic || h == htab->root.hgot)
2e9b04
+  if (h == htab->hdynamic || h == htab->hgot)
2e9b04
     sym->st_shndx = SHN_ABS;
2e9b04
 
2e9b04
   return TRUE;
2e9b04
@@ -3091,7 +3077,7 @@ static bfd_boolean
2e9b04
 m32r_elf_finish_dynamic_sections (bfd *output_bfd,
2e9b04
 				  struct bfd_link_info *info)
2e9b04
 {
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   bfd *dynobj;
2e9b04
   asection *sdyn;
2e9b04
   asection *sgot;
2e9b04
@@ -3104,12 +3090,12 @@ m32r_elf_finish_dynamic_sections (bfd *o
2e9b04
   if (htab == NULL)
2e9b04
     return FALSE;
2e9b04
 
2e9b04
-  dynobj = htab->root.dynobj;
2e9b04
+  dynobj = htab->dynobj;
2e9b04
 
2e9b04
-  sgot = htab->root.sgotplt;
2e9b04
+  sgot = htab->sgotplt;
2e9b04
   sdyn = bfd_get_linker_section (dynobj, ".dynamic");
2e9b04
 
2e9b04
-  if (htab->root.dynamic_sections_created)
2e9b04
+  if (htab->dynamic_sections_created)
2e9b04
     {
2e9b04
       asection *splt;
2e9b04
       Elf32_External_Dyn *dyncon, *dynconend;
2e9b04
@@ -3132,17 +3118,17 @@ m32r_elf_finish_dynamic_sections (bfd *o
2e9b04
 	      break;
2e9b04
 
2e9b04
 	    case DT_PLTGOT:
2e9b04
-	      s = htab->root.sgotplt;
2e9b04
+	      s = htab->sgotplt;
2e9b04
 	      goto get_vma;
2e9b04
 	    case DT_JMPREL:
2e9b04
-	      s = htab->root.srelplt;
2e9b04
+	      s = htab->srelplt;
2e9b04
 	    get_vma:
2e9b04
 	      dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
2e9b04
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
2e9b04
 	      break;
2e9b04
 
2e9b04
 	    case DT_PLTRELSZ:
2e9b04
-	      s = htab->root.srelplt;
2e9b04
+	      s = htab->srelplt;
2e9b04
 	      dyn.d_un.d_val = s->size;
2e9b04
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
2e9b04
 	      break;
2e9b04
@@ -3150,7 +3136,7 @@ m32r_elf_finish_dynamic_sections (bfd *o
2e9b04
 	}
2e9b04
 
2e9b04
       /* Fill in the first entry in the procedure linkage table.  */
2e9b04
-      splt = htab->root.splt;
2e9b04
+      splt = htab->splt;
2e9b04
       if (splt && splt->size > 0)
2e9b04
 	{
2e9b04
 	  if (bfd_link_pic (info))
2e9b04
@@ -3369,7 +3355,7 @@ m32r_elf_check_relocs (bfd *abfd,
2e9b04
   struct elf_link_hash_entry **sym_hashes;
2e9b04
   const Elf_Internal_Rela *rel;
2e9b04
   const Elf_Internal_Rela *rel_end;
2e9b04
-  struct elf_m32r_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   bfd *dynobj;
2e9b04
   asection *sreloc;
2e9b04
 
2e9b04
@@ -3384,7 +3370,7 @@ m32r_elf_check_relocs (bfd *abfd,
2e9b04
   if (htab == NULL)
2e9b04
     return FALSE;
2e9b04
 
2e9b04
-  dynobj = htab->root.dynobj;
2e9b04
+  dynobj = htab->dynobj;
2e9b04
 
2e9b04
   rel_end = relocs + sec->reloc_count;
2e9b04
   for (rel = relocs; rel < rel_end; rel++)
2e9b04
@@ -3406,7 +3392,7 @@ m32r_elf_check_relocs (bfd *abfd,
2e9b04
 	}
2e9b04
 
2e9b04
       /* Some relocs require a global offset table.  */
2e9b04
-      if (htab->root.sgot == NULL)
2e9b04
+      if (htab->sgot == NULL)
2e9b04
 	{
2e9b04
 	  switch (r_type)
2e9b04
 	    {
2e9b04
@@ -3423,7 +3409,7 @@ m32r_elf_check_relocs (bfd *abfd,
2e9b04
 	    case R_M32R_GOTPC_LO:
2e9b04
 	    case R_M32R_GOT24:
2e9b04
 	      if (dynobj == NULL)
2e9b04
-		htab->root.dynobj = dynobj = abfd;
2e9b04
+		htab->dynobj = dynobj = abfd;
2e9b04
 	      if (!_bfd_elf_create_got_section (dynobj, info))
2e9b04
 		return FALSE;
2e9b04
 	      break;
2e9b04
@@ -3540,7 +3526,7 @@ m32r_elf_check_relocs (bfd *abfd,
2e9b04
 	      struct elf_dyn_relocs **head;
2e9b04
 
2e9b04
 	      if (dynobj == NULL)
2e9b04
-		htab->root.dynobj = dynobj = abfd;
2e9b04
+		htab->dynobj = dynobj = abfd;
2e9b04
 
2e9b04
 	      /* When creating a shared object, we must copy these
2e9b04
 		 relocs into the output file.  We create a reloc
2e9b04
diff -rup binutils.orig/bfd/elf32-m68hc1x.h binutils-2.35/bfd/elf32-m68hc1x.h
2e9b04
--- binutils.orig/bfd/elf32-m68hc1x.h	2020-07-30 15:04:05.378466625 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-m68hc1x.h	2020-07-30 15:04:16.710393941 +0100
2e9b04
@@ -120,9 +120,6 @@ struct m68hc11_elf_link_hash_table
2e9b04
   int top_index;
2e9b04
   asection **input_list;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   bfd_boolean (* size_one_stub)  (struct bfd_hash_entry*, void*);
2e9b04
   bfd_boolean (* build_one_stub) (struct bfd_hash_entry*, void*);
2e9b04
 };
2e9b04
diff -rup binutils.orig/bfd/elf32-m68k.c binutils-2.35/bfd/elf32-m68k.c
2e9b04
--- binutils.orig/bfd/elf32-m68k.c	2020-07-30 15:04:05.363466721 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-m68k.c	2020-07-30 15:04:16.710393941 +0100
2e9b04
@@ -889,9 +889,6 @@ struct elf_m68k_link_hash_table
2e9b04
 {
2e9b04
   struct elf_link_hash_table root;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* The PLT format used by this link, or NULL if the format has not
2e9b04
      yet been chosen.  */
2e9b04
   const struct elf_m68k_plt_info *plt_info;
2e9b04
@@ -2836,7 +2833,7 @@ elf_m68k_check_relocs (bfd *abfd,
2e9b04
 		      void *vpp;
2e9b04
 		      Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		      isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->sym_cache,
2e9b04
+		      isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->root.sym_cache,
2e9b04
 						    abfd, r_symndx);
2e9b04
 		      if (isym == NULL)
2e9b04
 			return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-metag.c binutils-2.35/bfd/elf32-metag.c
2e9b04
--- binutils.orig/bfd/elf32-metag.c	2020-07-30 15:04:05.379466619 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-metag.c	2020-07-30 15:04:16.711393934 +0100
2e9b04
@@ -823,9 +823,6 @@ struct elf_metag_link_hash_table
2e9b04
   asection **input_list;
2e9b04
   Elf_Internal_Sym **all_local_syms;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Data for LDM relocations.  */
2e9b04
   union
2e9b04
   {
2e9b04
@@ -2098,7 +2095,7 @@ elf_metag_check_relocs (bfd *abfd,
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-microblaze.c binutils-2.35/bfd/elf32-microblaze.c
2e9b04
--- binutils.orig/bfd/elf32-microblaze.c	2020-07-30 15:04:05.367466696 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-microblaze.c	2020-07-30 15:04:16.711393934 +0100
2e9b04
@@ -744,9 +744,6 @@ struct elf32_mb_link_hash_table
2e9b04
 {
2e9b04
   struct elf_link_hash_table elf;
2e9b04
 
2e9b04
-  /* Small local sym to section mapping cache.  */
2e9b04
-  struct sym_cache sym_sec;
2e9b04
-
2e9b04
   /* TLS Local Dynamic GOT Entry */
2e9b04
   union {
2e9b04
     bfd_signed_vma refcount;
2e9b04
@@ -2523,7 +2520,7 @@ microblaze_elf_check_relocs (bfd * abfd,
2e9b04
 		    Elf_Internal_Sym *isym;
2e9b04
 		    void *vpp;
2e9b04
 
2e9b04
-		    isym = bfd_sym_from_r_symndx (&htab->sym_sec,
2e9b04
+		    isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						  abfd, r_symndx);
2e9b04
 		    if (isym == NULL)
2e9b04
 		      return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-nds32.c binutils-2.35/bfd/elf32-nds32.c
2e9b04
--- binutils.orig/bfd/elf32-nds32.c	2020-07-30 15:04:05.365466709 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-nds32.c	2020-07-30 15:04:16.712393928 +0100
2e9b04
@@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *a
2e9b04
       return NULL;
2e9b04
     }
2e9b04
 
2e9b04
-  ret->sdynbss = NULL;
2e9b04
-  ret->srelbss = NULL;
2e9b04
   ret->sym_ld_script = NULL;
2e9b04
 
2e9b04
   return &ret->root.root;
2e9b04
@@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd *
2e9b04
 	 initialize them at run time.  The linker script puts the .dynbss
2e9b04
 	 section into the .bss section of the final image.  */
2e9b04
       s = bfd_make_section (abfd, ".dynbss");
2e9b04
-      htab->sdynbss = s;
2e9b04
+      htab->root.sdynbss = s;
2e9b04
       if (s == NULL
2e9b04
 	  || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED))
2e9b04
 	return FALSE;
2e9b04
@@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd *
2e9b04
 	{
2e9b04
 	  s = bfd_make_section (abfd, (bed->default_use_rela_p
2e9b04
 				       ? ".rela.bss" : ".rel.bss"));
2e9b04
-	  htab->srelbss = s;
2e9b04
+	  htab->root.srelbss = s;
2e9b04
 	  if (s == NULL
2e9b04
 	      || !bfd_set_section_flags (s, flags | SEC_READONLY)
2e9b04
 	      || !bfd_set_section_alignment (s, ptralign))
2e9b04
@@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct
2e9b04
      same memory location for the variable.  */
2e9b04
 
2e9b04
   htab = nds32_elf_hash_table (info);
2e9b04
-  s = htab->sdynbss;
2e9b04
+  s = htab->root.sdynbss;
2e9b04
   BFD_ASSERT (s != NULL);
2e9b04
 
2e9b04
   /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker
2e9b04
@@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct
2e9b04
     {
2e9b04
       asection *srel;
2e9b04
 
2e9b04
-      srel = htab->srelbss;
2e9b04
+      srel = htab->root.srelbss;
2e9b04
       BFD_ASSERT (srel != NULL);
2e9b04
       srel->size += sizeof (Elf32_External_Rela);
2e9b04
       h->needs_copy = 1;
2e9b04
@@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struc
2e9b04
 		  void *vpp;
2e9b04
 
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
+						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elf32-nds32.h binutils-2.35/bfd/elf32-nds32.h
2e9b04
--- binutils.orig/bfd/elf32-nds32.h	2020-07-30 15:04:05.378466625 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-nds32.h	2020-07-30 15:04:16.712393928 +0100
2e9b04
@@ -122,13 +122,6 @@ struct elf_nds32_link_hash_table
2e9b04
 {
2e9b04
   struct elf_link_hash_table root;
2e9b04
 
2e9b04
-  /* Short-cuts to get to dynamic linker sections.  */
2e9b04
-  asection *sdynbss;
2e9b04
-  asection *srelbss;
2e9b04
-
2e9b04
-  /* Small local sym to section mapping cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Target dependent options.  */
2e9b04
   int relax_fp_as_gp;		/* --mrelax-omit-fp.  */
2e9b04
   int eliminate_gc_relocs;	/* --meliminate-gc-relocs.  */
2e9b04
diff -rup binutils.orig/bfd/elf32-nios2.c binutils-2.35/bfd/elf32-nios2.c
2e9b04
--- binutils.orig/bfd/elf32-nios2.c	2020-07-30 15:04:05.375466645 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-nios2.c	2020-07-30 15:04:16.712393928 +0100
2e9b04
@@ -1808,9 +1808,6 @@ struct elf32_nios2_link_hash_table
2e9b04
       bfd_vma offset;
2e9b04
     } tls_ldm_got;
2e9b04
 
2e9b04
-    /* Small local sym cache.  */
2e9b04
-    struct sym_cache sym_cache;
2e9b04
-
2e9b04
     bfd_vma res_n_size;
2e9b04
   };
2e9b04
 
2e9b04
@@ -4902,7 +4899,7 @@ nios2_elf32_check_relocs (bfd *abfd, str
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-or1k.c binutils-2.35/bfd/elf32-or1k.c
2e9b04
--- binutils.orig/bfd/elf32-or1k.c	2020-07-30 15:04:05.371466670 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-or1k.c	2020-07-30 15:04:16.713393921 +0100
2e9b04
@@ -916,9 +916,6 @@ struct elf_or1k_link_hash_table
2e9b04
 {
2e9b04
   struct elf_link_hash_table root;
2e9b04
 
2e9b04
-  /* Small local sym to section mapping cache.  */
2e9b04
-  struct sym_cache sym_sec;
2e9b04
-
2e9b04
   bfd_boolean saw_plta;
2e9b04
 };
2e9b04
 
2e9b04
@@ -2151,7 +2148,7 @@ or1k_elf_check_relocs (bfd *abfd,
2e9b04
 		    Elf_Internal_Sym *isym;
2e9b04
 		    void *vpp;
2e9b04
 
2e9b04
-		    isym = bfd_sym_from_r_symndx (&htab->sym_sec,
2e9b04
+		    isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
 						  abfd, r_symndx);
2e9b04
 		    if (isym == NULL)
2e9b04
 		      return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.35/bfd/elf32-ppc.c
2e9b04
--- binutils.orig/bfd/elf32-ppc.c	2020-07-30 15:04:05.359466747 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-ppc.c	2020-07-30 15:04:16.713393921 +0100
2e9b04
@@ -2212,9 +2212,6 @@ struct ppc_elf_link_hash_table
2e9b04
   int plt_slot_size;
2e9b04
   /* The size of the first PLT entry.  */
2e9b04
   int plt_initial_entry_size;
2e9b04
-
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
 };
2e9b04
 
2e9b04
 /* Rename some of the generic section flags to better document how they
2e9b04
@@ -2952,7 +2949,7 @@ ppc_elf_check_relocs (bfd *abfd,
2e9b04
       ifunc = NULL;
2e9b04
       if (h == NULL && htab->elf.target_os != is_vxworks)
2e9b04
 	{
2e9b04
-	  Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 							  abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
@@ -3335,7 +3332,7 @@ ppc_elf_check_relocs (bfd *abfd,
2e9b04
 	      asection *s;
2e9b04
 	      Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-	      isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	      isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					    abfd, r_symndx);
2e9b04
 	      if (isym == NULL)
2e9b04
 		return FALSE;
2e9b04
@@ -3495,7 +3492,7 @@ ppc_elf_check_relocs (bfd *abfd,
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.35/bfd/elf32-s390.c
2e9b04
--- binutils.orig/bfd/elf32-s390.c	2020-07-30 15:04:05.376466638 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-s390.c	2020-07-30 15:04:16.714393915 +0100
2e9b04
@@ -746,9 +746,6 @@ struct elf_s390_link_hash_table
2e9b04
     bfd_signed_vma refcount;
2e9b04
     bfd_vma offset;
2e9b04
   } tls_ldm_got;
2e9b04
-
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
 };
2e9b04
 
2e9b04
 /* Get the s390 ELF linker hash table from a link_info structure.  */
2e9b04
@@ -930,7 +927,7 @@ elf_s390_check_relocs (bfd *abfd,
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
@@ -1281,7 +1278,7 @@ elf_s390_check_relocs (bfd *abfd,
2e9b04
 		  asection *s;
2e9b04
 		  void *vpp;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
@@ -3722,7 +3719,7 @@ elf_s390_finish_dynamic_sections (bfd *o
2e9b04
 	    if (local_plt[i].plt.offset != (bfd_vma) -1)
2e9b04
 	      {
2e9b04
 		asection *sec = local_plt[i].sec;
2e9b04
-		isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i);
2e9b04
+		isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i);
2e9b04
 		if (isym == NULL)
2e9b04
 		  return FALSE;
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elf32-sh.c binutils-2.35/bfd/elf32-sh.c
2e9b04
--- binutils.orig/bfd/elf32-sh.c	2020-07-30 15:04:05.376466638 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-sh.c	2020-07-30 15:04:16.714393915 +0100
2e9b04
@@ -2160,8 +2160,6 @@ struct elf_sh_link_hash_table
2e9b04
   struct elf_link_hash_table root;
2e9b04
 
2e9b04
   /* Short-cuts to get to dynamic linker sections.  */
2e9b04
-  asection *sdynbss;
2e9b04
-  asection *srelbss;
2e9b04
   asection *sfuncdesc;
2e9b04
   asection *srelfuncdesc;
2e9b04
   asection *srofixup;
2e9b04
@@ -2169,9 +2167,6 @@ struct elf_sh_link_hash_table
2e9b04
   /* The (unloaded but important) VxWorks .rela.plt.unloaded section.  */
2e9b04
   asection *srelplt2;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* A counter or offset to track a TLS got entry.  */
2e9b04
   union
2e9b04
     {
2e9b04
@@ -2439,7 +2434,7 @@ sh_elf_create_dynamic_sections (bfd *abf
2e9b04
 	 section into the .bss section of the final image.  */
2e9b04
       s = bfd_make_section_anyway_with_flags (abfd, ".dynbss",
2e9b04
 					      SEC_ALLOC | SEC_LINKER_CREATED);
2e9b04
-      htab->sdynbss = s;
2e9b04
+      htab->root.sdynbss = s;
2e9b04
       if (s == NULL)
2e9b04
 	return FALSE;
2e9b04
 
2e9b04
@@ -2460,7 +2455,7 @@ sh_elf_create_dynamic_sections (bfd *abf
2e9b04
 						  (bed->default_use_rela_p
2e9b04
 						   ? ".rela.bss" : ".rel.bss"),
2e9b04
 						  flags | SEC_READONLY);
2e9b04
-	  htab->srelbss = s;
2e9b04
+	  htab->root.srelbss = s;
2e9b04
 	  if (s == NULL
2e9b04
 	      || !bfd_set_section_alignment (s, ptralign))
2e9b04
 	    return FALSE;
2e9b04
@@ -2580,7 +2575,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd
2e9b04
      both the dynamic object and the regular object will refer to the
2e9b04
      same memory location for the variable.  */
2e9b04
 
2e9b04
-  s = htab->sdynbss;
2e9b04
+  s = htab->root.sdynbss;
2e9b04
   BFD_ASSERT (s != NULL);
2e9b04
 
2e9b04
   /* We must generate a R_SH_COPY reloc to tell the dynamic linker to
2e9b04
@@ -2591,7 +2586,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd
2e9b04
     {
2e9b04
       asection *srel;
2e9b04
 
2e9b04
-      srel = htab->srelbss;
2e9b04
+      srel = htab->root.srelbss;
2e9b04
       BFD_ASSERT (srel != NULL);
2e9b04
       srel->size += sizeof (Elf32_External_Rela);
2e9b04
       h->needs_copy = 1;
2e9b04
@@ -3151,7 +3146,7 @@ sh_elf_size_dynamic_sections (bfd *outpu
2e9b04
 	  || s == htab->root.sgotplt
2e9b04
 	  || s == htab->sfuncdesc
2e9b04
 	  || s == htab->srofixup
2e9b04
-	  || s == htab->sdynbss)
2e9b04
+	  || s == htab->root.sdynbss)
2e9b04
 	{
2e9b04
 	  /* Strip this section if we don't need it; see the
2e9b04
 	     comment below.  */
2e9b04
@@ -5679,7 +5674,7 @@ sh_elf_check_relocs (bfd *abfd, struct b
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-tic6x.c binutils-2.35/bfd/elf32-tic6x.c
2e9b04
--- binutils.orig/bfd/elf32-tic6x.c	2020-07-30 15:04:05.366466702 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-tic6x.c	2020-07-30 15:04:16.714393915 +0100
2e9b04
@@ -46,9 +46,6 @@ struct elf32_tic6x_link_hash_table
2e9b04
   /* C6X specific command line arguments.  */
2e9b04
   struct elf32_tic6x_params params;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* The output BFD, for convenience.  */
2e9b04
   bfd *obfd;
2e9b04
 
2e9b04
@@ -2729,7 +2726,7 @@ elf32_tic6x_check_relocs (bfd *abfd, str
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf32-tilepro.c binutils-2.35/bfd/elf32-tilepro.c
2e9b04
--- binutils.orig/bfd/elf32-tilepro.c	2020-07-30 15:04:05.364466715 +0100
2e9b04
+++ binutils-2.35/bfd/elf32-tilepro.c	2020-07-30 15:04:16.715393908 +0100
2e9b04
@@ -727,19 +727,11 @@ tilepro_elf_mkobject (bfd *abfd)
2e9b04
 #include "elf/common.h"
2e9b04
 #include "elf/internal.h"
2e9b04
 
2e9b04
-struct tilepro_elf_link_hash_table
2e9b04
-{
2e9b04
-  struct elf_link_hash_table elf;
2e9b04
-
2e9b04
-  /* Small local sym to section mapping cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-};
2e9b04
-
2e9b04
 /* Get the Tilepro ELF linker hash table from a link_info structure.  */
2e9b04
 #define tilepro_elf_hash_table(p) \
2e9b04
   (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
2e9b04
   == TILEPRO_ELF_DATA \
2e9b04
-  ? ((struct tilepro_elf_link_hash_table *) ((p)->hash)) : NULL)
2e9b04
+  ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL)
2e9b04
 
2e9b04
 static reloc_howto_type *
2e9b04
 tilepro_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
2e9b04
@@ -1184,14 +1176,14 @@ link_hash_newfunc (struct bfd_hash_entry
2e9b04
 static struct bfd_link_hash_table *
2e9b04
 tilepro_elf_link_hash_table_create (bfd *abfd)
2e9b04
 {
2e9b04
-  struct tilepro_elf_link_hash_table *ret;
2e9b04
-  size_t amt = sizeof (struct tilepro_elf_link_hash_table);
2e9b04
+  struct elf_link_hash_table *ret;
2e9b04
+  size_t amt = sizeof (struct elf_link_hash_table);
2e9b04
 
2e9b04
-  ret = (struct tilepro_elf_link_hash_table *) bfd_zmalloc (amt);
2e9b04
+  ret = (struct elf_link_hash_table *) bfd_zmalloc (amt);
2e9b04
   if (ret == NULL)
2e9b04
     return NULL;
2e9b04
 
2e9b04
-  if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
2e9b04
+  if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc,
2e9b04
 				      sizeof (struct tilepro_elf_link_hash_entry),
2e9b04
 				      TILEPRO_ELF_DATA))
2e9b04
     {
2e9b04
@@ -1199,7 +1191,7 @@ tilepro_elf_link_hash_table_create (bfd
2e9b04
       return NULL;
2e9b04
     }
2e9b04
 
2e9b04
-  return &ret->elf.root;
2e9b04
+  return &ret->root;
2e9b04
 }
2e9b04
 
2e9b04
 /* Create the .got section.  */
2e9b04
@@ -1402,7 +1394,7 @@ static bfd_boolean
2e9b04
 tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
2e9b04
 			  asection *sec, const Elf_Internal_Rela *relocs)
2e9b04
 {
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   Elf_Internal_Shdr *symtab_hdr;
2e9b04
   struct elf_link_hash_entry **sym_hashes;
2e9b04
   const Elf_Internal_Rela *rel;
2e9b04
@@ -1423,8 +1415,8 @@ tilepro_elf_check_relocs (bfd *abfd, str
2e9b04
 
2e9b04
   BFD_ASSERT (is_tilepro_elf (abfd) || num_relocs == 0);
2e9b04
 
2e9b04
-  if (htab->elf.dynobj == NULL)
2e9b04
-    htab->elf.dynobj = abfd;
2e9b04
+  if (htab->dynobj == NULL)
2e9b04
+    htab->dynobj = abfd;
2e9b04
 
2e9b04
   rel_end = relocs + num_relocs;
2e9b04
   for (rel = relocs; rel < rel_end; rel++)
2e9b04
@@ -1569,9 +1561,9 @@ tilepro_elf_check_relocs (bfd *abfd, str
2e9b04
 	      }
2e9b04
 	  }
2e9b04
 
2e9b04
-	  if (htab->elf.sgot == NULL)
2e9b04
+	  if (htab->sgot == NULL)
2e9b04
 	    {
2e9b04
-	      if (!tilepro_elf_create_got_section (htab->elf.dynobj, info))
2e9b04
+	      if (!tilepro_elf_create_got_section (htab->dynobj, info))
2e9b04
 		return FALSE;
2e9b04
 	    }
2e9b04
 	  break;
2e9b04
@@ -1716,7 +1708,7 @@ tilepro_elf_check_relocs (bfd *abfd, str
2e9b04
 	      if (sreloc == NULL)
2e9b04
 		{
2e9b04
 		  sreloc = _bfd_elf_make_dynamic_reloc_section
2e9b04
-		    (sec, htab->elf.dynobj, 2, abfd, /*rela?*/ TRUE);
2e9b04
+		    (sec, htab->dynobj, 2, abfd, /*rela?*/ TRUE);
2e9b04
 
2e9b04
 		  if (sreloc == NULL)
2e9b04
 		    return FALSE;
2e9b04
@@ -1754,7 +1746,7 @@ tilepro_elf_check_relocs (bfd *abfd, str
2e9b04
 		{
2e9b04
 		  size_t amt = sizeof *p;
2e9b04
 		  p = ((struct elf_dyn_relocs *)
2e9b04
-		       bfd_alloc (htab->elf.dynobj, amt));
2e9b04
+		       bfd_alloc (htab->dynobj, amt));
2e9b04
 		  if (p == NULL)
2e9b04
 		    return FALSE;
2e9b04
 		  p->next = *head;
2e9b04
@@ -1850,14 +1842,14 @@ static bfd_boolean
2e9b04
 tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
2e9b04
 				   struct elf_link_hash_entry *h)
2e9b04
 {
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   asection *s, *srel;
2e9b04
 
2e9b04
   htab = tilepro_elf_hash_table (info);
2e9b04
   BFD_ASSERT (htab != NULL);
2e9b04
 
2e9b04
   /* Make sure we know what is going on here.  */
2e9b04
-  BFD_ASSERT (htab->elf.dynobj != NULL
2e9b04
+  BFD_ASSERT (htab->dynobj != NULL
2e9b04
 	      && (h->needs_plt
2e9b04
 		  || h->is_weakalias
2e9b04
 		  || (h->def_dynamic
2e9b04
@@ -1947,13 +1939,13 @@ tilepro_elf_adjust_dynamic_symbol (struc
2e9b04
      .rel.bss section we are going to use.  */
2e9b04
   if ((h->root.u.def.section->flags & SEC_READONLY) != 0)
2e9b04
     {
2e9b04
-      s = htab->elf.sdynrelro;
2e9b04
-      srel = htab->elf.sreldynrelro;
2e9b04
+      s = htab->sdynrelro;
2e9b04
+      srel = htab->sreldynrelro;
2e9b04
     }
2e9b04
   else
2e9b04
     {
2e9b04
-      s = htab->elf.sdynbss;
2e9b04
-      srel = htab->elf.srelbss;
2e9b04
+      s = htab->sdynbss;
2e9b04
+      srel = htab->srelbss;
2e9b04
     }
2e9b04
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
2e9b04
     {
2e9b04
@@ -1971,7 +1963,7 @@ static bfd_boolean
2e9b04
 allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
2e9b04
 {
2e9b04
   struct bfd_link_info *info;
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   struct elf_dyn_relocs *p;
2e9b04
 
2e9b04
   if (h->root.type == bfd_link_hash_indirect)
2e9b04
@@ -1981,7 +1973,7 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
   htab = tilepro_elf_hash_table (info);
2e9b04
   BFD_ASSERT (htab != NULL);
2e9b04
 
2e9b04
-  if (htab->elf.dynamic_sections_created
2e9b04
+  if (htab->dynamic_sections_created
2e9b04
       && h->plt.refcount > 0)
2e9b04
     {
2e9b04
       /* Make sure this symbol is output as a dynamic symbol.
2e9b04
@@ -1995,7 +1987,7 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
 
2e9b04
       if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
2e9b04
 	{
2e9b04
-	  asection *s = htab->elf.splt;
2e9b04
+	  asection *s = htab->splt;
2e9b04
 
2e9b04
 	  /* Allocate room for the header.  */
2e9b04
 	  if (s->size == 0)
2e9b04
@@ -2021,10 +2013,10 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
 	  s->size += PLT_ENTRY_SIZE;
2e9b04
 
2e9b04
 	  /* We also need to make an entry in the .got.plt section.  */
2e9b04
-	  htab->elf.sgotplt->size += GOT_ENTRY_SIZE;
2e9b04
+	  htab->sgotplt->size += GOT_ENTRY_SIZE;
2e9b04
 
2e9b04
 	  /* We also need to make an entry in the .rela.plt section.  */
2e9b04
-	  htab->elf.srelplt->size += TILEPRO_ELF_RELA_BYTES;
2e9b04
+	  htab->srelplt->size += TILEPRO_ELF_RELA_BYTES;
2e9b04
 	}
2e9b04
       else
2e9b04
 	{
2e9b04
@@ -2060,22 +2052,22 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
 	    return FALSE;
2e9b04
 	}
2e9b04
 
2e9b04
-      s = htab->elf.sgot;
2e9b04
+      s = htab->sgot;
2e9b04
       h->got.offset = s->size;
2e9b04
       s->size += TILEPRO_BYTES_PER_WORD;
2e9b04
       /* R_TILEPRO_IMM16_Xn_TLS_GD entries need 2 consecutive GOT slots. */
2e9b04
       if (tls_type == GOT_TLS_GD)
2e9b04
 	s->size += TILEPRO_BYTES_PER_WORD;
2e9b04
-      dyn = htab->elf.dynamic_sections_created;
2e9b04
+      dyn = htab->dynamic_sections_created;
2e9b04
       /* R_TILEPRO_IMM16_Xn_TLS_IE_xxx needs one dynamic relocation,
2e9b04
 	 R_TILEPRO_IMM16_Xn_TLS_GD_xxx needs two if local symbol and two if
2e9b04
 	 global.  */
2e9b04
       if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE)
2e9b04
-	htab->elf.srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES;
2e9b04
+	htab->srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES;
2e9b04
       else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
2e9b04
 						bfd_link_pic (info),
2e9b04
 						h))
2e9b04
-	htab->elf.srelgot->size += TILEPRO_ELF_RELA_BYTES;
2e9b04
+	htab->srelgot->size += TILEPRO_ELF_RELA_BYTES;
2e9b04
     }
2e9b04
   else
2e9b04
     h->got.offset = (bfd_vma) -1;
2e9b04
@@ -2134,7 +2126,7 @@ allocate_dynrelocs (struct elf_link_hash
2e9b04
       if (!h->non_got_ref
2e9b04
 	  && ((h->def_dynamic
2e9b04
 	       && !h->def_regular)
2e9b04
-	      || (htab->elf.dynamic_sections_created
2e9b04
+	      || (htab->dynamic_sections_created
2e9b04
 		  && (h->root.type == bfd_link_hash_undefweak
2e9b04
 		      || h->root.type == bfd_link_hash_undefined))))
2e9b04
 	{
2e9b04
@@ -2195,14 +2187,14 @@ tilepro_elf_size_dynamic_sections (bfd *
2e9b04
 {
2e9b04
   (void)output_bfd;
2e9b04
 
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   bfd *dynobj;
2e9b04
   asection *s;
2e9b04
   bfd *ibfd;
2e9b04
 
2e9b04
   htab = tilepro_elf_hash_table (info);
2e9b04
   BFD_ASSERT (htab != NULL);
2e9b04
-  dynobj = htab->elf.dynobj;
2e9b04
+  dynobj = htab->dynobj;
2e9b04
   BFD_ASSERT (dynobj != NULL);
2e9b04
 
2e9b04
   if (elf_hash_table (info)->dynamic_sections_created)
2e9b04
@@ -2268,8 +2260,8 @@ tilepro_elf_size_dynamic_sections (bfd *
2e9b04
       locsymcount = symtab_hdr->sh_info;
2e9b04
       end_local_got = local_got + locsymcount;
2e9b04
       local_tls_type = _bfd_tilepro_elf_local_got_tls_type (ibfd);
2e9b04
-      s = htab->elf.sgot;
2e9b04
-      srel = htab->elf.srelgot;
2e9b04
+      s = htab->sgot;
2e9b04
+      srel = htab->srelgot;
2e9b04
       for (; local_got < end_local_got; ++local_got, ++local_tls_type)
2e9b04
 	{
2e9b04
 	  if (*local_got > 0)
2e9b04
@@ -2290,19 +2282,19 @@ tilepro_elf_size_dynamic_sections (bfd *
2e9b04
 
2e9b04
   /* Allocate global sym .plt and .got entries, and space for global
2e9b04
      sym dynamic relocs.  */
2e9b04
-  elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
2e9b04
+  elf_link_hash_traverse (htab, allocate_dynrelocs, info);
2e9b04
 
2e9b04
   if (elf_hash_table (info)->dynamic_sections_created)
2e9b04
     {
2e9b04
       /* If the .got section is more than 0x8000 bytes, we add
2e9b04
 	 0x8000 to the value of _GLOBAL_OFFSET_TABLE_, so that 16
2e9b04
 	 bit relocations have a greater chance of working. */
2e9b04
-      if (htab->elf.sgot->size >= 0x8000
2e9b04
+      if (htab->sgot->size >= 0x8000
2e9b04
 	  && elf_hash_table (info)->hgot->root.u.def.value == 0)
2e9b04
 	elf_hash_table (info)->hgot->root.u.def.value = 0x8000;
2e9b04
     }
2e9b04
 
2e9b04
-  if (htab->elf.sgotplt)
2e9b04
+  if (htab->sgotplt)
2e9b04
     {
2e9b04
       struct elf_link_hash_entry *got;
2e9b04
       got = elf_link_hash_lookup (elf_hash_table (info),
2e9b04
@@ -2313,14 +2305,14 @@ tilepro_elf_size_dynamic_sections (bfd *
2e9b04
 	 entries and there is no refeence to _GLOBAL_OFFSET_TABLE_.  */
2e9b04
       if ((got == NULL
2e9b04
 	   || !got->ref_regular_nonweak)
2e9b04
-	  && (htab->elf.sgotplt->size
2e9b04
+	  && (htab->sgotplt->size
2e9b04
 	      == GOTPLT_HEADER_SIZE)
2e9b04
-	  && (htab->elf.splt == NULL
2e9b04
-	      || htab->elf.splt->size == 0)
2e9b04
-	  && (htab->elf.sgot == NULL
2e9b04
-	      || (htab->elf.sgot->size
2e9b04
+	  && (htab->splt == NULL
2e9b04
+	      || htab->splt->size == 0)
2e9b04
+	  && (htab->sgot == NULL
2e9b04
+	      || (htab->sgot->size
2e9b04
 		  == get_elf_backend_data (output_bfd)->got_header_size)))
2e9b04
-	htab->elf.sgotplt->size = 0;
2e9b04
+	htab->sgotplt->size = 0;
2e9b04
     }
2e9b04
 
2e9b04
   /* The check_relocs and adjust_dynamic_symbol entry points have
2e9b04
@@ -2331,11 +2323,11 @@ tilepro_elf_size_dynamic_sections (bfd *
2e9b04
       if ((s->flags & SEC_LINKER_CREATED) == 0)
2e9b04
 	continue;
2e9b04
 
2e9b04
-      if (s == htab->elf.splt
2e9b04
-	  || s == htab->elf.sgot
2e9b04
-	  || s == htab->elf.sgotplt
2e9b04
-	  || s == htab->elf.sdynbss
2e9b04
-	  || s == htab->elf.sdynrelro)
2e9b04
+      if (s == htab->splt
2e9b04
+	  || s == htab->sgot
2e9b04
+	  || s == htab->sgotplt
2e9b04
+	  || s == htab->sdynbss
2e9b04
+	  || s == htab->sdynrelro)
2e9b04
 	{
2e9b04
 	  /* Strip this section if we don't need it; see the
2e9b04
 	     comment below.  */
2e9b04
@@ -2527,7 +2519,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 			      Elf_Internal_Sym *local_syms,
2e9b04
 			      asection **local_sections)
2e9b04
 {
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
   Elf_Internal_Shdr *symtab_hdr;
2e9b04
   struct elf_link_hash_entry **sym_hashes;
2e9b04
   bfd_vma *local_got_offsets;
2e9b04
@@ -2758,7 +2750,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 	case R_TILEPRO_IMM16_X1_GOT_HA:
2e9b04
 	  /* Relocation is to the entry for this symbol in the global
2e9b04
 	     offset table.  */
2e9b04
-	  if (htab->elf.sgot == NULL)
2e9b04
+	  if (htab->sgot == NULL)
2e9b04
 	    abort ();
2e9b04
 
2e9b04
 	  if (h != NULL)
2e9b04
@@ -2792,7 +2784,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 		  else
2e9b04
 		    {
2e9b04
 		      bfd_put_32 (output_bfd, relocation,
2e9b04
-					  htab->elf.sgot->contents + off);
2e9b04
+					  htab->sgot->contents + off);
2e9b04
 		      h->got.offset |= 1;
2e9b04
 		    }
2e9b04
 		}
2e9b04
@@ -2820,11 +2812,11 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 
2e9b04
 		      /* We need to generate a R_TILEPRO_RELATIVE reloc
2e9b04
 			 for the dynamic linker.  */
2e9b04
-		      s = htab->elf.srelgot;
2e9b04
+		      s = htab->srelgot;
2e9b04
 		      BFD_ASSERT (s != NULL);
2e9b04
 
2e9b04
-		      outrel.r_offset = (htab->elf.sgot->output_section->vma
2e9b04
-					 + htab->elf.sgot->output_offset
2e9b04
+		      outrel.r_offset = (htab->sgot->output_section->vma
2e9b04
+					 + htab->sgot->output_offset
2e9b04
 					 + off);
2e9b04
 		      outrel.r_info = ELF32_R_INFO (0, R_TILEPRO_RELATIVE);
2e9b04
 		      outrel.r_addend = relocation;
2e9b04
@@ -2833,7 +2825,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 		    }
2e9b04
 
2e9b04
 		  bfd_put_32 (output_bfd, relocation,
2e9b04
-				      htab->elf.sgot->contents + off);
2e9b04
+				      htab->sgot->contents + off);
2e9b04
 		  local_got_offsets[r_symndx] |= 1;
2e9b04
 		}
2e9b04
 	    }
2e9b04
@@ -2845,7 +2837,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 	     procedure linkage table.  */
2e9b04
 	  BFD_ASSERT (h != NULL);
2e9b04
 
2e9b04
-	  if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL)
2e9b04
+	  if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL)
2e9b04
 	    {
2e9b04
 	      /* We didn't make a PLT entry for this symbol.  This
2e9b04
 		 happens when statically linking PIC code, or when
2e9b04
@@ -2853,8 +2845,8 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 	      break;
2e9b04
 	    }
2e9b04
 
2e9b04
-	  relocation = (htab->elf.splt->output_section->vma
2e9b04
-			+ htab->elf.splt->output_offset
2e9b04
+	  relocation = (htab->splt->output_section->vma
2e9b04
+			+ htab->splt->output_offset
2e9b04
 			+ h->plt.offset);
2e9b04
 	  unresolved_reloc = FALSE;
2e9b04
 	  break;
2e9b04
@@ -2993,7 +2985,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 		      outrel.r_addend = relocation + rel->r_addend;
2e9b04
 
2e9b04
 		      if (is_plt)
2e9b04
-			sec = htab->elf.splt;
2e9b04
+			sec = htab->splt;
2e9b04
 
2e9b04
 		      if (bfd_is_abs_section (sec))
2e9b04
 			indx = 0;
2e9b04
@@ -3016,7 +3008,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 
2e9b04
 			  if (indx == 0)
2e9b04
 			    {
2e9b04
-			      osec = htab->elf.text_index_section;
2e9b04
+			      osec = htab->text_index_section;
2e9b04
 			      indx = elf_section_data (osec)->dynindx;
2e9b04
 			    }
2e9b04
 
2e9b04
@@ -3142,7 +3134,7 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 	      local_got_offsets[r_symndx] |= 1;
2e9b04
 	    }
2e9b04
 
2e9b04
-	  if (htab->elf.sgot == NULL)
2e9b04
+	  if (htab->sgot == NULL)
2e9b04
 	    abort ();
2e9b04
 
2e9b04
 	  if ((off & 1) != 0)
2e9b04
@@ -3153,13 +3145,13 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 	      int indx = 0;
2e9b04
 	      bfd_boolean need_relocs = FALSE;
2e9b04
 
2e9b04
-	      if (htab->elf.srelgot == NULL)
2e9b04
+	      if (htab->srelgot == NULL)
2e9b04
 		abort ();
2e9b04
 
2e9b04
 	      if (h != NULL)
2e9b04
 	      {
2e9b04
 		bfd_boolean dyn;
2e9b04
-		dyn = htab->elf.dynamic_sections_created;
2e9b04
+		dyn = htab->dynamic_sections_created;
2e9b04
 
2e9b04
 		if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
2e9b04
 						     bfd_link_pic (info),
2e9b04
@@ -3190,18 +3182,18 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 		  case R_TILEPRO_IMM16_X0_TLS_IE_HA:
2e9b04
 		  case R_TILEPRO_IMM16_X1_TLS_IE_HA:
2e9b04
 		    if (need_relocs) {
2e9b04
-		      bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
2e9b04
-		      outrel.r_offset = (htab->elf.sgot->output_section->vma
2e9b04
-				       + htab->elf.sgot->output_offset + off);
2e9b04
+		      bfd_put_32 (output_bfd, 0, htab->sgot->contents + off);
2e9b04
+		      outrel.r_offset = (htab->sgot->output_section->vma
2e9b04
+				       + htab->sgot->output_offset + off);
2e9b04
 		      outrel.r_addend = 0;
2e9b04
 		      if (indx == 0)
2e9b04
 			outrel.r_addend = relocation - dtpoff_base (info);
2e9b04
 		      outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_TPOFF32);
2e9b04
-		      tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
2e9b04
+		      tilepro_elf_append_rela_32 (output_bfd, htab->srelgot,
2e9b04
 						  &outrel);
2e9b04
 		    } else {
2e9b04
 		      bfd_put_32 (output_bfd, tpoff (info, relocation),
2e9b04
-				  htab->elf.sgot->contents + off);
2e9b04
+				  htab->sgot->contents + off);
2e9b04
 		    }
2e9b04
 		    break;
2e9b04
 
2e9b04
@@ -3214,31 +3206,31 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 		  case R_TILEPRO_IMM16_X0_TLS_GD_HA:
2e9b04
 		  case R_TILEPRO_IMM16_X1_TLS_GD_HA:
2e9b04
 		    if (need_relocs) {
2e9b04
-		      outrel.r_offset = (htab->elf.sgot->output_section->vma
2e9b04
-				       + htab->elf.sgot->output_offset + off);
2e9b04
+		      outrel.r_offset = (htab->sgot->output_section->vma
2e9b04
+				       + htab->sgot->output_offset + off);
2e9b04
 		      outrel.r_addend = 0;
2e9b04
 		      outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32);
2e9b04
-		      bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
2e9b04
-		      tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
2e9b04
+		      bfd_put_32 (output_bfd, 0, htab->sgot->contents + off);
2e9b04
+		      tilepro_elf_append_rela_32 (output_bfd, htab->srelgot,
2e9b04
 						  &outrel);
2e9b04
 		      if (indx == 0)
2e9b04
 			{
2e9b04
 			  BFD_ASSERT (! unresolved_reloc);
2e9b04
 			  bfd_put_32 (output_bfd,
2e9b04
 				      relocation - dtpoff_base (info),
2e9b04
-				      (htab->elf.sgot->contents + off +
2e9b04
+				      (htab->sgot->contents + off +
2e9b04
 				       TILEPRO_BYTES_PER_WORD));
2e9b04
 			}
2e9b04
 		      else
2e9b04
 			{
2e9b04
 			  bfd_put_32 (output_bfd, 0,
2e9b04
-				      (htab->elf.sgot->contents + off +
2e9b04
+				      (htab->sgot->contents + off +
2e9b04
 				       TILEPRO_BYTES_PER_WORD));
2e9b04
 			  outrel.r_info = ELF32_R_INFO (indx,
2e9b04
 							R_TILEPRO_TLS_DTPOFF32);
2e9b04
 			  outrel.r_offset += TILEPRO_BYTES_PER_WORD;
2e9b04
 			  tilepro_elf_append_rela_32 (output_bfd,
2e9b04
-						      htab->elf.srelgot, &outrel);
2e9b04
+						      htab->srelgot, &outrel);
2e9b04
 			}
2e9b04
 		    }
2e9b04
 
2e9b04
@@ -3249,9 +3241,9 @@ tilepro_elf_relocate_section (bfd *outpu
2e9b04
 			 symbol binding locally.  Mark it as belonging
2e9b04
 			 to module 1, the executable.  */
2e9b04
 		      bfd_put_32 (output_bfd, 1,
2e9b04
-				  htab->elf.sgot->contents + off );
2e9b04
+				  htab->sgot->contents + off );
2e9b04
 		      bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
2e9b04
-				  htab->elf.sgot->contents + off +
2e9b04
+				  htab->sgot->contents + off +
2e9b04
 				  TILEPRO_BYTES_PER_WORD);
2e9b04
 		   }
2e9b04
 		   break;
2e9b04
@@ -3411,7 +3403,7 @@ tilepro_elf_finish_dynamic_symbol (bfd *
2e9b04
 				   struct elf_link_hash_entry *h,
2e9b04
 				   Elf_Internal_Sym *sym)
2e9b04
 {
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
 
2e9b04
   htab = tilepro_elf_hash_table (info);
2e9b04
   BFD_ASSERT (htab != NULL);
2e9b04
@@ -3431,9 +3423,9 @@ tilepro_elf_finish_dynamic_symbol (bfd *
2e9b04
 
2e9b04
       BFD_ASSERT (h->dynindx != -1);
2e9b04
 
2e9b04
-      splt = htab->elf.splt;
2e9b04
-      srela = htab->elf.srelplt;
2e9b04
-      sgotplt = htab->elf.sgotplt;
2e9b04
+      splt = htab->splt;
2e9b04
+      srela = htab->srelplt;
2e9b04
+      sgotplt = htab->sgotplt;
2e9b04
 
2e9b04
       if (splt == NULL || srela == NULL)
2e9b04
        abort ();
2e9b04
@@ -3481,8 +3473,8 @@ tilepro_elf_finish_dynamic_symbol (bfd *
2e9b04
 
2e9b04
       /* This symbol has an entry in the GOT.  Set it up.  */
2e9b04
 
2e9b04
-      sgot = htab->elf.sgot;
2e9b04
-      srela = htab->elf.srelgot;
2e9b04
+      sgot = htab->sgot;
2e9b04
+      srela = htab->srelgot;
2e9b04
       BFD_ASSERT (sgot != NULL && srela != NULL);
2e9b04
 
2e9b04
       rela.r_offset = (sgot->output_section->vma
2e9b04
@@ -3528,16 +3520,16 @@ tilepro_elf_finish_dynamic_symbol (bfd *
2e9b04
 		       + h->root.u.def.section->output_offset);
2e9b04
       rela.r_info = ELF32_R_INFO (h->dynindx, R_TILEPRO_COPY);
2e9b04
       rela.r_addend = 0;
2e9b04
-      if (h->root.u.def.section == htab->elf.sdynrelro)
2e9b04
-	s = htab->elf.sreldynrelro;
2e9b04
+      if (h->root.u.def.section == htab->sdynrelro)
2e9b04
+	s = htab->sreldynrelro;
2e9b04
       else
2e9b04
-	s = htab->elf.srelbss;
2e9b04
+	s = htab->srelbss;
2e9b04
       tilepro_elf_append_rela_32 (output_bfd, s, &rela);
2e9b04
     }
2e9b04
 
2e9b04
   /* Mark some specially defined symbols as absolute. */
2e9b04
-  if (h == htab->elf.hdynamic
2e9b04
-      || (h == htab->elf.hgot || h == htab->elf.hplt))
2e9b04
+  if (h == htab->hdynamic
2e9b04
+      || (h == htab->hgot || h == htab->hplt))
2e9b04
     sym->st_shndx = SHN_ABS;
2e9b04
 
2e9b04
   return TRUE;
2e9b04
@@ -3551,7 +3543,7 @@ tilepro_finish_dyn (bfd *output_bfd, str
2e9b04
 		    asection *splt ATTRIBUTE_UNUSED)
2e9b04
 {
2e9b04
   Elf32_External_Dyn *dyncon, *dynconend;
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
 
2e9b04
   htab = tilepro_elf_hash_table (info);
2e9b04
   BFD_ASSERT (htab != NULL);
2e9b04
@@ -3567,15 +3559,15 @@ tilepro_finish_dyn (bfd *output_bfd, str
2e9b04
       switch (dyn.d_tag)
2e9b04
 	{
2e9b04
 	case DT_PLTGOT:
2e9b04
-	  s = htab->elf.sgotplt;
2e9b04
+	  s = htab->sgotplt;
2e9b04
 	  dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
2e9b04
 	  break;
2e9b04
 	case DT_JMPREL:
2e9b04
-	  s = htab->elf.srelplt;
2e9b04
+	  s = htab->srelplt;
2e9b04
 	  dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
2e9b04
 	  break;
2e9b04
 	case DT_PLTRELSZ:
2e9b04
-	  s = htab->elf.srelplt;
2e9b04
+	  s = htab->srelplt;
2e9b04
 	  dyn.d_un.d_val = s->size;
2e9b04
 	  break;
2e9b04
 	default:
2e9b04
@@ -3593,11 +3585,11 @@ tilepro_elf_finish_dynamic_sections (bfd
2e9b04
 {
2e9b04
   bfd *dynobj;
2e9b04
   asection *sdyn;
2e9b04
-  struct tilepro_elf_link_hash_table *htab;
2e9b04
+  struct elf_link_hash_table *htab;
2e9b04
 
2e9b04
   htab = tilepro_elf_hash_table (info);
2e9b04
   BFD_ASSERT (htab != NULL);
2e9b04
-  dynobj = htab->elf.dynobj;
2e9b04
+  dynobj = htab->dynobj;
2e9b04
 
2e9b04
   sdyn = bfd_get_linker_section (dynobj, ".dynamic");
2e9b04
 
2e9b04
@@ -3606,7 +3598,7 @@ tilepro_elf_finish_dynamic_sections (bfd
2e9b04
       asection *splt;
2e9b04
       bfd_boolean ret;
2e9b04
 
2e9b04
-      splt = htab->elf.splt;
2e9b04
+      splt = htab->splt;
2e9b04
       BFD_ASSERT (splt != NULL && sdyn != NULL);
2e9b04
 
2e9b04
       ret = tilepro_finish_dyn (output_bfd, info, dynobj, sdyn, splt);
2e9b04
@@ -3627,42 +3619,42 @@ tilepro_elf_finish_dynamic_sections (bfd
2e9b04
 	  = PLT_ENTRY_SIZE;
2e9b04
     }
2e9b04
 
2e9b04
-  if (htab->elf.sgotplt)
2e9b04
+  if (htab->sgotplt)
2e9b04
     {
2e9b04
-      if (bfd_is_abs_section (htab->elf.sgotplt->output_section))
2e9b04
+      if (bfd_is_abs_section (htab->sgotplt->output_section))
2e9b04
 	{
2e9b04
 	  _bfd_error_handler
2e9b04
-	    (_("discarded output section: `%pA'"), htab->elf.sgotplt);
2e9b04
+	    (_("discarded output section: `%pA'"), htab->sgotplt);
2e9b04
 	  return FALSE;
2e9b04
 	}
2e9b04
 
2e9b04
-      if (htab->elf.sgotplt->size > 0)
2e9b04
+      if (htab->sgotplt->size > 0)
2e9b04
 	{
2e9b04
 	  /* Write the first two entries in .got.plt, needed for the dynamic
2e9b04
 	     linker.  */
2e9b04
 	  bfd_put_32 (output_bfd, (bfd_vma) -1,
2e9b04
-		      htab->elf.sgotplt->contents);
2e9b04
+		      htab->sgotplt->contents);
2e9b04
 	  bfd_put_32 (output_bfd, (bfd_vma) 0,
2e9b04
-		      htab->elf.sgotplt->contents + GOT_ENTRY_SIZE);
2e9b04
+		      htab->sgotplt->contents + GOT_ENTRY_SIZE);
2e9b04
 	}
2e9b04
 
2e9b04
-      elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize
2e9b04
+      elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize
2e9b04
 	= GOT_ENTRY_SIZE;
2e9b04
     }
2e9b04
 
2e9b04
-  if (htab->elf.sgot)
2e9b04
+  if (htab->sgot)
2e9b04
     {
2e9b04
-      if (htab->elf.sgot->size > 0)
2e9b04
+      if (htab->sgot->size > 0)
2e9b04
 	{
2e9b04
 	  /* Set the first entry in the global offset table to the address of
2e9b04
 	     the dynamic section.  */
2e9b04
 	  bfd_vma val = (sdyn ?
2e9b04
 			 sdyn->output_section->vma + sdyn->output_offset :
2e9b04
 			 0);
2e9b04
-	  bfd_put_32 (output_bfd, val, htab->elf.sgot->contents);
2e9b04
+	  bfd_put_32 (output_bfd, val, htab->sgot->contents);
2e9b04
 	}
2e9b04
 
2e9b04
-      elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize
2e9b04
+      elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize
2e9b04
 	= GOT_ENTRY_SIZE;
2e9b04
     }
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.35/bfd/elf64-ppc.c
2e9b04
--- binutils.orig/bfd/elf64-ppc.c	2020-07-30 15:04:05.363466721 +0100
2e9b04
+++ binutils-2.35/bfd/elf64-ppc.c	2020-07-30 15:04:16.716393902 +0100
2e9b04
@@ -3250,9 +3250,6 @@ struct ppc_link_hash_table
2e9b04
 
2e9b04
   /* Incremented every time we size stubs.  */
2e9b04
   unsigned int stub_iteration;
2e9b04
-
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
 };
2e9b04
 
2e9b04
 /* Rename some of the generic section flags to better document how they
2e9b04
@@ -4383,7 +4380,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd
2e9b04
 	      Elf_Internal_Sym *isym;
2e9b04
 	      asection *s;
2e9b04
 
2e9b04
-	      isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, r_symndx);
2e9b04
+	      isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd,
2e9b04
+					    r_symndx);
2e9b04
 	      if (isym == NULL)
2e9b04
 		{
2e9b04
 		  if (elf_section_data (opd)->relocs != relocs)
2e9b04
@@ -4684,7 +4682,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
2e9b04
 	}
2e9b04
       else
2e9b04
 	{
2e9b04
-	  Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 							  abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
@@ -4955,7 +4953,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
2e9b04
 	      {
2e9b04
 		Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					      abfd, r_symndx);
2e9b04
 		if (isym == NULL)
2e9b04
 		  return FALSE;
2e9b04
@@ -5231,7 +5229,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.35/bfd/elf64-s390.c
2e9b04
--- binutils.orig/bfd/elf64-s390.c	2020-07-30 15:04:05.369466683 +0100
2e9b04
+++ binutils-2.35/bfd/elf64-s390.c	2020-07-30 15:04:16.716393902 +0100
2e9b04
@@ -663,9 +663,6 @@ struct elf_s390_link_hash_table
2e9b04
     bfd_vma offset;
2e9b04
   } tls_ldm_got;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Options passed from the linker.  */
2e9b04
   struct s390_elf_params *params;
2e9b04
 };
2e9b04
@@ -852,7 +849,7 @@ elf_s390_check_relocs (bfd *abfd,
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
@@ -1216,7 +1213,7 @@ elf_s390_check_relocs (bfd *abfd,
2e9b04
 		  asection *s;
2e9b04
 		  void *vpp;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
@@ -2258,7 +2255,7 @@ elf_s390_relocate_section (bfd *output_b
2e9b04
 				  & 0xff00f000) == 0xe300c000
2e9b04
 			      && bfd_get_8 (input_bfd,
2e9b04
 					    contents + rel->r_offset + 3) == 0x04))
2e9b04
-		      && (isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		      && (isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 							input_bfd, r_symndx))
2e9b04
 		      && isym->st_shndx != SHN_ABS
2e9b04
 		      && h != htab->elf.hdynamic
2e9b04
@@ -3572,7 +3569,7 @@ elf_s390_finish_dynamic_sections (bfd *o
2e9b04
 	    if (local_plt[i].plt.offset != (bfd_vma) -1)
2e9b04
 	      {
2e9b04
 		asection *sec = local_plt[i].sec;
2e9b04
-		isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i);
2e9b04
+		isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i);
2e9b04
 		if (isym == NULL)
2e9b04
 		  return FALSE;
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.35/bfd/elf64-x86-64.c
2e9b04
--- binutils.orig/bfd/elf64-x86-64.c	2020-07-30 15:04:05.365466709 +0100
2e9b04
+++ binutils-2.35/bfd/elf64-x86-64.c	2020-07-30 15:04:16.717393895 +0100
2e9b04
@@ -1371,7 +1371,7 @@ elf_x86_64_tls_transition (struct bfd_li
2e9b04
 	    {
2e9b04
 	      Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-	      isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	      isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					    abfd, r_symndx);
2e9b04
 	      name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
2e9b04
 	    }
2e9b04
@@ -1559,7 +1559,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd
2e9b04
   if (h == NULL)
2e9b04
     {
2e9b04
       Elf_Internal_Sym *isym
2e9b04
-	= bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
2e9b04
+	= bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, r_symndx);
2e9b04
 
2e9b04
       /* Skip relocation against undefined symbols.  */
2e9b04
       if (isym->st_shndx == SHN_UNDEF)
2e9b04
@@ -1907,7 +1907,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    goto error_return;
2e9b04
@@ -2308,7 +2308,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru
2e9b04
 		  asection *s;
2e9b04
 		  void **vpp;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    goto error_return;
2e9b04
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c
2e9b04
--- binutils.orig/bfd/elfnn-aarch64.c	2020-07-30 15:04:05.371466670 +0100
2e9b04
+++ binutils-2.35/bfd/elfnn-aarch64.c	2020-07-30 15:04:16.717393895 +0100
2e9b04
@@ -2643,9 +2643,6 @@ struct elf_aarch64_link_hash_table
2e9b04
   /* The bytes of the subsequent PLT entry.  */
2e9b04
   const bfd_byte *plt_entry;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* For convenience in allocate_dynrelocs.  */
2e9b04
   bfd *obfd;
2e9b04
 
2e9b04
@@ -7611,7 +7608,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
 					abfd, r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
@@ -7838,7 +7835,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
2e9b04
 		asection *s;
2e9b04
 		void **vpp;
2e9b04
 
2e9b04
-		isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2e9b04
 					      abfd, r_symndx);
2e9b04
 		if (isym == NULL)
2e9b04
 		  return FALSE;
2e9b04
Only in binutils-2.35/bfd: elfnn-aarch64.c.orig
2e9b04
diff -rup binutils.orig/bfd/elfnn-riscv.c binutils-2.35/bfd/elfnn-riscv.c
2e9b04
--- binutils.orig/bfd/elfnn-riscv.c	2020-07-30 15:04:05.365466709 +0100
2e9b04
+++ binutils-2.35/bfd/elfnn-riscv.c	2020-07-30 15:04:16.718393889 +0100
2e9b04
@@ -113,9 +113,6 @@ struct riscv_elf_link_hash_table
2e9b04
   /* Short-cuts to get to dynamic linker sections.  */
2e9b04
   asection *sdyntdata;
2e9b04
 
2e9b04
-  /* Small local sym to section mapping cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* The max alignment of output sections.  */
2e9b04
   bfd_vma max_alignment;
2e9b04
 };
2e9b04
@@ -681,7 +678,7 @@ riscv_elf_check_relocs (bfd *abfd, struc
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elfxx-mips.c binutils-2.35/bfd/elfxx-mips.c
2e9b04
--- binutils.orig/bfd/elfxx-mips.c	2020-07-30 15:04:05.376466638 +0100
2e9b04
+++ binutils-2.35/bfd/elfxx-mips.c	2020-07-30 15:04:16.719393882 +0100
2e9b04
@@ -527,9 +527,6 @@ struct mips_elf_link_hash_table
2e9b04
      returns null.  */
2e9b04
   asection *(*add_stub_section) (const char *, asection *, asection *);
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Is the PLT header compressed?  */
2e9b04
   unsigned int plt_header_is_comp : 1;
2e9b04
 };
2e9b04
@@ -4401,7 +4398,7 @@ mips_elf_resolve_got_page_ref (void **re
2e9b04
       Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
       /* Read in the symbol.  */
2e9b04
-      isym = bfd_sym_from_r_symndx (&htab->sym_cache, ref->u.abfd,
2e9b04
+      isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ref->u.abfd,
2e9b04
 				    ref->symndx);
2e9b04
       if (isym == NULL)
2e9b04
 	{
2e9b04
diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.35/bfd/elfxx-sparc.c
2e9b04
--- binutils.orig/bfd/elfxx-sparc.c	2020-07-30 15:04:05.360466741 +0100
2e9b04
+++ binutils-2.35/bfd/elfxx-sparc.c	2020-07-30 15:04:16.719393882 +0100
2e9b04
@@ -1391,7 +1391,8 @@ _bfd_sparc_elf_check_relocs (bfd *abfd,
2e9b04
       if (r_symndx < symtab_hdr->sh_info)
2e9b04
 	{
2e9b04
 	  /* A local symbol.  */
2e9b04
-	  isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
2e9b04
+	  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd,
2e9b04
+					r_symndx);
2e9b04
 	  if (isym == NULL)
2e9b04
 	    return FALSE;
2e9b04
 
2e9b04
diff -rup binutils.orig/bfd/elfxx-sparc.h binutils-2.35/bfd/elfxx-sparc.h
2e9b04
--- binutils.orig/bfd/elfxx-sparc.h	2020-07-30 15:04:05.367466696 +0100
2e9b04
+++ binutils-2.35/bfd/elfxx-sparc.h	2020-07-30 15:04:16.719393882 +0100
2e9b04
@@ -55,9 +55,6 @@ struct _bfd_sparc_elf_link_hash_table
2e9b04
     bfd_vma offset;
2e9b04
   } tls_ldm_got;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* Used by local STT_GNU_IFUNC symbols.  */
2e9b04
   htab_t loc_hash_table;
2e9b04
   void *loc_hash_memory;
2e9b04
diff -rup binutils.orig/bfd/elfxx-tilegx.c binutils-2.35/bfd/elfxx-tilegx.c
2e9b04
--- binutils.orig/bfd/elfxx-tilegx.c	2020-07-30 15:04:05.362466728 +0100
2e9b04
+++ binutils-2.35/bfd/elfxx-tilegx.c	2020-07-30 15:04:16.719393882 +0100
2e9b04
@@ -835,9 +835,6 @@ struct tilegx_elf_link_hash_table
2e9b04
   /* Whether LE transition has been disabled for some of the
2e9b04
      sections.  */
2e9b04
   bfd_boolean disable_le_transition;
2e9b04
-
2e9b04
-  /* Small local sym to section mapping cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
 };
2e9b04
 
2e9b04
 
2e9b04
@@ -1979,7 +1976,7 @@ tilegx_elf_check_relocs (bfd *abfd, stru
2e9b04
 		  void *vpp;
2e9b04
 		  Elf_Internal_Sym *isym;
2e9b04
 
2e9b04
-		  isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2e9b04
+		  isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2e9b04
 						abfd, r_symndx);
2e9b04
 		  if (isym == NULL)
2e9b04
 		    return FALSE;
2e9b04
diff -rup binutils.orig/bfd/elfxx-x86.h binutils-2.35/bfd/elfxx-x86.h
2e9b04
--- binutils.orig/bfd/elfxx-x86.h	2020-07-30 15:04:05.378466625 +0100
2e9b04
+++ binutils-2.35/bfd/elfxx-x86.h	2020-07-30 15:04:16.720393876 +0100
2e9b04
@@ -468,9 +468,6 @@ struct elf_x86_link_hash_table
2e9b04
   /* The amount of space used by the jump slots in the GOT.  */
2e9b04
   bfd_vma sgotplt_jump_table_size;
2e9b04
 
2e9b04
-  /* Small local sym cache.  */
2e9b04
-  struct sym_cache sym_cache;
2e9b04
-
2e9b04
   /* _TLS_MODULE_BASE_ symbol.  */
2e9b04
   struct bfd_link_hash_entry *tls_module_base;
2e9b04