]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
make more use of elf_symtab_hdr
authorAlan Modra <amodra@gmail.com>
Fri, 17 Apr 2026 01:26:31 +0000 (10:56 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 17 Apr 2026 01:26:31 +0000 (10:56 +0930)
This is a mostly mechanical replacement of elf_tdata (abfd)->symtab_hdr
with elf_symtab_hdr (abfd).

65 files changed:
bfd/arc-got.h
bfd/elf-m10200.c
bfd/elf-m10300.c
bfd/elf.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-crx.c
bfd/elf32-csky.c
bfd/elf32-d10v.c
bfd/elf32-dlx.c
bfd/elf32-epiphany.c
bfd/elf32-fr30.c
bfd/elf32-frv.c
bfd/elf32-ft32.c
bfd/elf32-h8300.c
bfd/elf32-hppa.c
bfd/elf32-ip2k.c
bfd/elf32-iq2000.c
bfd/elf32-lm32.c
bfd/elf32-m32c.c
bfd/elf32-m32r.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc1x.c
bfd/elf32-m68k.c
bfd/elf32-mcore.c
bfd/elf32-mep.c
bfd/elf32-metag.c
bfd/elf32-microblaze.c
bfd/elf32-moxie.c
bfd/elf32-msp430.c
bfd/elf32-mt.c
bfd/elf32-nds32.c
bfd/elf32-or1k.c
bfd/elf32-pru.c
bfd/elf32-rl78.c
bfd/elf32-rx.c
bfd/elf32-score.c
bfd/elf32-score7.c
bfd/elf32-spu.c
bfd/elf32-tilepro.c
bfd/elf32-v850.c
bfd/elf32-vax.c
bfd/elf32-visium.c
bfd/elf32-xstormy16.c
bfd/elf32-xtensa.c
bfd/elf32-z80.c
bfd/elf64-alpha.c
bfd/elf64-bpf.c
bfd/elf64-hppa.c
bfd/elf64-ia64-vms.c
bfd/elf64-mmix.c
bfd/elfcode.h
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-tilegx.c
bfd/elfxx-x86.c

index b2eeef9079a32f59261df5f888f795e30dfb38c7..5e9e48f7eb5eac6d6e126326f41834c96029b28d 100644 (file)
@@ -61,7 +61,7 @@ arc_get_local_got_ents (bfd * abfd)
 {
   if (elf_local_got_ents (abfd) == NULL)
     {
-      bfd_size_type amt = (elf_tdata (abfd)->symtab_hdr.sh_info
+      bfd_size_type amt = (elf_symtab_hdr (abfd).sh_info
                           * sizeof (*elf_local_got_ents (abfd)));
       elf_local_got_ents (abfd) = bfd_zmalloc (amt);
       if (elf_local_got_ents (abfd) == NULL)
index cc194fa0165951810a576065d74ff299eaa1f66c..b5b4bae99f4fdb51ece8732cfb12beda98b5d4b6 100644 (file)
@@ -349,7 +349,7 @@ mn10200_elf_relocate_section (bfd *output_bfd,
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
@@ -499,7 +499,7 @@ mn10200_elf_relax_delete_bytes (bfd *abfd, asection *sec,
     }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     {
@@ -584,7 +584,7 @@ mn10200_elf_relax_section (bfd *abfd,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -1237,7 +1237,7 @@ mn10200_elf_symbol_address_p (bfd *abfd,
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
   /* Examine all the local symbols.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     {
       if (isym->st_shndx == sec_shndx
@@ -1289,7 +1289,7 @@ mn10200_elf_get_relocated_section_contents (bfd *output_bfd,
                                                       relocatable,
                                                       symbols);
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   bfd_byte *orig_data = data;
   if (data == NULL)
index 9988b3edcbbc4f93ca3a72f8ee512982bcfe9509..357e65f914d6a701853334f5e2021e0560205fe5 100644 (file)
@@ -1068,7 +1068,7 @@ mn10300_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
   sym_hashes = elf_sym_hashes (abfd);
 
@@ -1978,7 +1978,7 @@ mn10300_elf_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel, *relend;
   Elf_Internal_Rela * trel;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
@@ -2476,7 +2476,7 @@ mn10300_elf_relax_delete_bytes (bfd *abfd,
      region are moved to the address of the start of the region, which
      actually means that they will address the byte beyond the end of
      the region once the deletion has been completed.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     {
@@ -2568,7 +2568,7 @@ mn10300_elf_symbol_address_p (bfd *abfd,
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
   /* Examine all the symbols.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     if (isym->st_shndx == sec_shndx
        && isym->st_value == addr)
@@ -2669,7 +2669,7 @@ mn10300_elf_relax_section (bfd *abfd,
           input_bfd = input_bfd->link.next)
        {
          /* We're going to need all the symbols for each bfd.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info != 0)
            {
              isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -3012,7 +3012,7 @@ mn10300_elf_relax_section (bfd *abfd,
           input_bfd = input_bfd->link.next)
        {
          /* We're going to need all the local symbols for each bfd.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info != 0)
            {
              isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -3275,7 +3275,7 @@ mn10300_elf_relax_section (bfd *abfd,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
@@ -4432,7 +4432,7 @@ mn10300_elf_get_relocated_section_contents (bfd *output_bfd,
                                                       relocatable,
                                                       symbols);
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   bfd_byte *orig_data = data;
   if (data == NULL)
index 5f02188b4b56a7eaa3e64dc568fbe0a26acce054..dcf8f61e0436b53ebc17304b566fe54d305f3cb8 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -676,7 +676,7 @@ group_signature (bfd *abfd, Elf_Internal_Shdr *ghdr)
     return NULL;
 
   /* Go read the symbol.  */
-  hdr = &elf_tdata (abfd)->symtab_hdr;
+  hdr = &elf_symtab_hdr (abfd);
   if (bfd_elf_get_elf_syms (abfd, hdr, 1, ghdr->sh_info,
                            &isym, esym, &eshndx) == NULL)
     return NULL;
@@ -3035,7 +3035,7 @@ bfd_sym_from_r_symndx (struct sym_cache *cache,
       unsigned char esym[sizeof (Elf64_External_Sym)];
       Elf_External_Sym_Shndx eshndx;
 
-      symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (abfd);
       if (bfd_elf_get_elf_syms (abfd, symtab_hdr, 1, r_symndx,
                                &cache->sym[ent], esym, &eshndx) == NULL)
        return NULL;
@@ -3958,7 +3958,7 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
        {
          Elf_Internal_Shdr *symtab_hdr;
 
-         symtab_hdr = &elf_tdata (igroup->owner)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (igroup->owner);
          extsymoff = symtab_hdr->sh_info;
        }
       h = elf_sym_hashes (igroup->owner)[symndx - extsymoff];
@@ -8753,7 +8753,7 @@ swap_out_syms (bfd *abfd,
 
   bed = get_elf_backend_data (abfd);
   symcount = bfd_get_symcount (abfd);
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   symtab_hdr->sh_type = SHT_SYMTAB;
   symtab_hdr->sh_entsize = bed->s->sizeof_sym;
   symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1);
@@ -9096,7 +9096,7 @@ _bfd_elf_get_symtab_upper_bound (bfd *abfd)
 {
   bfd_size_type symcount;
   long symtab_size;
-  Elf_Internal_Shdr *hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *hdr = &elf_symtab_hdr (abfd);
 
   symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
   if (symcount > LONG_MAX / sizeof (asymbol *))
index 8601a3d3c351adf13a459420246fc62d002518ab..ed58d634157032b396fc40cdacfbc02f82a2a430 100644 (file)
@@ -1459,7 +1459,7 @@ elf_arc_relocate_section (bfd *                     output_bfd,
   Elf_Internal_Rela *           relend;
   struct elf_link_hash_table *   htab = elf_hash_table (info);
 
-  symtab_hdr = &((elf_tdata (input_bfd))->symtab_hdr);
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = wrel = relocs;
@@ -1995,7 +1995,7 @@ elf_arc_check_relocs (bfd *                        abfd,
     htab->dynobj = abfd;
 
   dynobj = (elf_hash_table (info))->dynobj;
-  symtab_hdr = &((elf_tdata (abfd))->symtab_hdr);
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -3010,7 +3010,7 @@ arc_elf_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
index ab9fdda7e8931ee73207925df9970c2b3ed04fa9..c3cb929658189ba6d3903aebfdd15f0e8a02bf37 100644 (file)
@@ -3550,7 +3550,7 @@ elf32_arm_allocate_local_sym_info (bfd *abfd)
         structure, this interferes with the work of memory checkers looking
         for buffer overruns.  So allocate each array individually.  */
 
-      num_syms = elf_tdata (abfd)->symtab_hdr.sh_info;
+      num_syms = elf_symtab_hdr (abfd).sh_info;
 
       elf_local_got_refcounts (abfd) = bfd_zalloc
        (abfd, num_syms * sizeof (* elf_local_got_refcounts (abfd)));
@@ -3610,7 +3610,7 @@ elf32_arm_create_local_iplt (bfd *abfd, unsigned long r_symndx)
   if (!elf32_arm_allocate_local_sym_info (abfd))
     return NULL;
 
-  BFD_ASSERT (r_symndx < elf_tdata (abfd)->symtab_hdr.sh_info);
+  BFD_ASSERT (r_symndx < elf_symtab_hdr (abfd).sh_info);
   BFD_ASSERT (r_symndx < elf32_arm_num_entries (abfd));
   ptr = &elf32_arm_local_iplt (abfd)[r_symndx];
   if (*ptr == NULL)
@@ -5924,7 +5924,7 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab,
   struct elf32_arm_stub_hash_entry *stub_entry;
   bool is_v8m, new_stub, cmse_invalid, ret = true;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_count = symtab_hdr->sh_size / bed->s->sizeof_sym;
   ext_start = symtab_hdr->sh_info;
   is_v8m = (out_attr[Tag_CPU_arch].i >= TAG_CPU_ARCH_V8M_BASE
@@ -6480,7 +6480,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
          num_a8_relocs = 0;
 
          /* We'll need the symbol table in a second.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info == 0)
            continue;
 
@@ -15927,7 +15927,7 @@ elf32_arm_gc_mark_extra_sections (struct bfd_link_info *info,
 
              sym_hashes = elf_sym_hashes (sub);
              bed = get_elf_backend_data (sub);
-             symtab_hdr = &elf_tdata (sub)->symtab_hdr;
+             symtab_hdr = &elf_symtab_hdr (sub);
              sym_count = symtab_hdr->sh_size / bed->s->sizeof_sym;
              ext_start = symtab_hdr->sh_info;
 
index 86ab019174ef9eddb781e1d8c9e714b3d7aca8a4..c41185226018297ae295059fcbe2dd203dc9a6b2 100644 (file)
@@ -1427,7 +1427,7 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   if (htab == NULL)
     return false;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -1922,7 +1922,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
   bool did_shrink = false;
   bool did_pad = false;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
   contents = elf_section_data (sec)->this_hdr.contents;
   relax_info = get_avr_relax_info (sec);
@@ -2191,7 +2191,7 @@ retrieve_local_syms (bfd *input_bfd)
   Elf_Internal_Sym *isymbuf;
   size_t locsymcount;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   locsymcount = symtab_hdr->sh_info;
 
   isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -2217,7 +2217,7 @@ retrieve_local_syms (bfd *input_bfd)
 static asection *
 get_elf_r_symndx_section (bfd *abfd, unsigned long r_symndx)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   asection *target_sec = NULL;
   if (r_symndx < symtab_hdr->sh_info)
     {
@@ -2271,7 +2271,7 @@ get_elf_r_symndx_section (bfd *abfd, unsigned long r_symndx)
 static bfd_vma
 get_elf_r_symndx_offset (bfd *abfd, unsigned long r_symndx)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   bfd_vma offset = 0;
 
   if (r_symndx < symtab_hdr->sh_info)
@@ -2529,7 +2529,7 @@ elf32_avr_relax_section (bfd *abfd,
   if (!(elf_elfheader (abfd)->e_flags & EF_AVR_LINKRELAX_PREPARED))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -3211,7 +3211,7 @@ elf32_avr_get_relocated_section_contents (bfd *output_bfd,
                                                       link_order, data,
                                                       relocatable,
                                                       symbols);
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   bfd_byte *orig_data = data;
   if (data == NULL)
@@ -3580,7 +3580,7 @@ get_local_syms (bfd *input_bfd, struct bfd_link_info *info)
       Elf_Internal_Shdr *symtab_hdr;
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
@@ -3659,7 +3659,7 @@ elf32_avr_size_stubs (bfd *output_bfd,
          Elf_Internal_Sym *local_syms;
 
          /* We'll need the symbol table in a second.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info == 0)
            continue;
 
index 4dda4ba372e93e33e5425e6fa41540973be0280b..0b87cd92b172d2b74f6f3655bf6221e25912bd16 100644 (file)
@@ -1179,7 +1179,7 @@ bfin_check_relocs (bfd * abfd,
     return true;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   local_got_refcounts = elf_local_got_refcounts (abfd);
 
@@ -1378,7 +1378,7 @@ bfin_relocate_section (bfd * output_bfd,
   Elf_Internal_Rela *relend;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   local_got_offsets = elf_local_got_offsets (input_bfd);
 
@@ -2506,7 +2506,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
     check_segment[2];
   int silence_segment_error = !bfd_link_pic (info);
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -4119,7 +4119,7 @@ _bfinfdpic_check_discarded_relocs (bfd *abfd, asection *sec,
       || sec->reloc_count == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel = elf_section_data (sec)->relocs;
@@ -4520,7 +4520,7 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -5307,7 +5307,7 @@ bfd_bfin_elf32_create_embedded_relocs (bfd *abfd,
   if (datasec->reloc_count == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
index dda2e6874f958e1816e3f4781042977598cf56cb..f405378761decfe8fcec1079c09707c0e7e587df 100644 (file)
@@ -715,7 +715,7 @@ cr16_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -1240,7 +1240,7 @@ elf32_cr16_relax_delete_bytes (struct bfd_link_info *link_info, bfd *abfd,
       irel->r_offset -= count;
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     {
@@ -1343,7 +1343,7 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
@@ -1480,7 +1480,7 @@ elf32_cr16_get_relocated_section_contents (bfd *output_bfd,
                                                       relocatable,
                                                       symbols);
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   bfd_byte *orig_data = data;
   if (data == NULL)
@@ -1723,7 +1723,7 @@ elf32_cr16_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
@@ -2680,7 +2680,7 @@ bfd_cr16_elf32_create_embedded_relocs (bfd *abfd,
   if (datasec->reloc_count == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
index 73d446c6fb00e1128beb475cd5802da2b2088c6b..4e89a30eddb0b31114d87155c35a5efcc25f8dc8 100644 (file)
@@ -995,7 +995,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 
   dynobj = htab->root.dynobj;
   local_got_offsets = elf_local_got_offsets (input_bfd);
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -2967,7 +2967,7 @@ cris_elf_check_relocs (bfd *abfd,
     return false;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   local_got_refcounts = elf_local_got_refcounts (abfd);
 
@@ -4007,7 +4007,7 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED,
      entries.  */
   if (h == NULL)
     {
-      Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd);
       bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (ibfd);
 
       BFD_ASSERT (local_got_refcounts != NULL);
index e2b3a1e1064f02f5c57331a7773ada4486d3005b..55255c51decf79f2fb018934115ae9f511c5375d 100644 (file)
@@ -624,7 +624,7 @@ elf32_crx_relax_delete_bytes (struct bfd_link_info *link_info, bfd *abfd,
     }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     {
@@ -740,7 +740,7 @@ elf32_crx_get_relocated_section_contents (bfd *output_bfd,
                                                       relocatable,
                                                       symbols);
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   bfd_byte *orig_data = data;
   if (data == NULL)
@@ -838,7 +838,7 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
@@ -980,7 +980,7 @@ elf32_crx_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
index db2e01bc900271b839630c53cf42e1bb0bb32d8e..a7c6f95692385519919a9c925c1af339c84a91bd 100644 (file)
@@ -1965,7 +1965,7 @@ csky_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got_refcounts)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got_refcounts + locsymcount;
       local_tls_type = csky_elf_local_got_tls_type (ibfd);
@@ -2487,7 +2487,7 @@ csky_elf_check_relocs (bfd * abfd,
   if (htab == NULL)
     return false;
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -3458,7 +3458,7 @@ elf32_csky_size_stubs (bfd *output_bfd,
          Elf_Internal_Sym *local_syms = NULL;
 
          /* We'll need the symbol table in a second.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info == 0)
            continue;
 
index 36c674ea6f63a3224aa9217481dfbab7b9c3de52..673743e0a0b4fe9bd485333d86fa76145d688e34 100644 (file)
@@ -276,7 +276,7 @@ elf32_d10v_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -401,7 +401,7 @@ elf32_d10v_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel, *relend;
   const char *name;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
index 7075de5ae9ec4a476ed85a9fa1a0825a5068b047..2dfeb4d7390b55f7bdf36bf9c600a29227771b9b 100644 (file)
@@ -433,7 +433,7 @@ elf32_dlx_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
index 07620729bd60d191fdbb8b979637b2cbed431921..5bb97ade08452093f4815843212cc97c40826360 100644 (file)
@@ -219,7 +219,7 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
                                               link_info->keep_memory);
@@ -484,7 +484,7 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
index 1dc840428e15f3a92c34950969f53ab12b04b196..1460aed77305f03b3b22f350ac491d690c4b5df6 100644 (file)
@@ -512,7 +512,7 @@ fr30_elf_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -656,7 +656,7 @@ fr30_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
index 371956386fc372f378a43af3ae031a8f78ed9ad1..54b16cd285c106532ee1dd75410389e39599d14a 100644 (file)
@@ -2670,7 +2670,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   int silence_segment_error = !bfd_link_pic (info);
   unsigned long insn;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -5505,7 +5505,7 @@ _frvfdpic_check_discarded_relocs (bfd *abfd, asection *sec,
       || sec->reloc_count == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel = elf_section_data (sec)->relocs;
@@ -6017,7 +6017,7 @@ elf32_frv_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   dynobj = elf_hash_table (info)->dynobj;
index f3e316612015b04e08b01d1c8a6a8c4fb2c24071..c95d2c8f3efd519f42e97c33a7a63479ca19535e 100644 (file)
@@ -356,7 +356,7 @@ ft32_elf_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -539,7 +539,7 @@ ft32_reloc_shortable
   r_type = ELF32_R_TYPE (irel->r_info);
   howto = &ft32_elf_howto_table [r_type];
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get the value of the symbol referred to by the reloc.  */
   if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
@@ -777,7 +777,7 @@ elf32_ft32_relax_delete_bytes (struct bfd_link_info *link_info, bfd * abfd,
   unsigned int symcount;
   Elf_Internal_Sym *isymbuf = NULL;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
   contents = elf_section_data (sec)->this_hdr.contents;
@@ -898,7 +898,7 @@ elf32_ft32_relax_delete_bytes (struct bfd_link_info *link_info, bfd * abfd,
   }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   if (isym)
     {
@@ -974,7 +974,7 @@ elf32_ft32_relax_is_branch_target (struct bfd_link_info *link_info,
   struct elf_link_hash_entry **start_hashes;
   unsigned int symcount;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Now we check for relocations pointing to ret.  */
   for (isec = abfd->sections; isec; isec = isec->next)
@@ -1110,7 +1110,7 @@ ft32_elf_relax_section (bfd *abfd,
       elf_section_data (sec)->this_hdr.contents = contents;
     }
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Read this BFD's local symbols if we haven't done so already.  */
   if (isymbuf == NULL && symtab_hdr->sh_info != 0)
index d97b669b07feab49368015caadc71e1c03a4e9fa..c690298758dde99e8eb519140a56237dad772cd7 100644 (file)
@@ -436,7 +436,7 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
@@ -712,7 +712,7 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -1521,7 +1521,7 @@ elf32_h8_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count)
     }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   isymend = isym + symtab_hdr->sh_info;
   for (; isym < isymend; isym++)
@@ -1568,7 +1568,7 @@ elf32_h8_symbol_address_p (bfd *abfd, asection *sec, bfd_vma addr)
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
   /* Examine all the symbols.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   isymend = isym + symtab_hdr->sh_info;
   for (; isym < isymend; isym++)
@@ -1622,7 +1622,7 @@ elf32_h8_get_relocated_section_contents (bfd *output_bfd,
                                                       relocatable,
                                                       symbols);
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   bfd_byte *orig_data = data;
   if (data == NULL)
index e3aa67c3fc6e6ff3e61c97bda88eb2673ddaa38a..6b837fe849659bb265b8dba7d64f1490546f7803 100644 (file)
@@ -311,7 +311,7 @@ struct elf32_hppa_link_hash_table
    bfd_hash_lookup ((table), (string), (create), (copy)))
 
 #define hppa_elf_local_got_tls_type(abfd) \
-  ((char *)(elf_local_got_offsets (abfd) + (elf_tdata (abfd)->symtab_hdr.sh_info * 2)))
+  ((char *)(elf_local_got_offsets (abfd) + (elf_symtab_hdr (abfd).sh_info * 2)))
 
 #define hh_name(hh) \
   (hh ? hh->eh.root.root.string : "<undef>")
@@ -1062,7 +1062,7 @@ elf32_hppa_optimized_tls_reloc (struct bfd_link_info *info ATTRIBUTE_UNUSED,
 static bfd_signed_vma *
 hppa32_elf_local_refcounts (bfd *abfd)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   bfd_signed_vma *local_refcounts;
 
   local_refcounts = elf_local_got_refcounts (abfd);
@@ -1112,7 +1112,7 @@ elf32_hppa_check_relocs (bfd *abfd,
   htab = hppa_link_hash_table (info);
   if (htab == NULL)
     return false;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   eh_syms = elf_sym_hashes (abfd);
   sreloc = NULL;
 
@@ -2124,7 +2124,7 @@ elf32_hppa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       local_tls_type = hppa_elf_local_got_tls_type (ibfd);
@@ -2496,7 +2496,7 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
       Elf_Internal_Shdr *symtab_hdr;
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
@@ -2672,7 +2672,7 @@ elf32_hppa_size_stubs
          Elf_Internal_Sym *local_syms;
 
          /* We'll need the symbol table in a second.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info == 0)
            continue;
 
@@ -3515,7 +3515,7 @@ elf32_hppa_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rela;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   htab = hppa_link_hash_table (info);
   if (htab == NULL)
index 06fa8ed54eed7da11fd24c11358c68df21166828..6d62157225f1213488ee6ec5087d3bbc839fae25 100644 (file)
@@ -582,7 +582,7 @@ adjust_all_relocations (bfd *abfd,
   unsigned int symcount;
   asection *stab;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
 
   shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
@@ -1102,7 +1102,7 @@ ip2k_elf_relax_section (bfd *abfd,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
                                               link_info->keep_memory);
@@ -1400,7 +1400,7 @@ ip2k_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
index 3cb74dec3f269a59c9c11afcfab759dd307b0826..56908098501ec7ea9cd55f59e2f0c5305d2be467 100644 (file)
@@ -469,7 +469,7 @@ iq2000_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -576,7 +576,7 @@ iq2000_elf_relocate_section (bfd *               output_bfd ATTRIBUTE_UNUSED,
   Elf_Internal_Rela *          rel;
   Elf_Internal_Rela *          relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
index 7bcf2f5ba601bc583d91058d8949f398f3888788..80846326b04529fdcc314419f025d0adf8993b4a 100644 (file)
@@ -724,7 +724,7 @@ lm32_elf_relocate_section (bfd *output_bfd,
                           Elf_Internal_Sym *local_syms,
                           asection **local_sections)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (input_bfd);
   struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
   Elf_Internal_Rela *rel, *relend;
   struct elf_lm32_link_hash_table *htab = lm32_elf_hash_table (info);
@@ -738,7 +738,7 @@ lm32_elf_relocate_section (bfd *output_bfd,
 
   sgot = htab->root.sgot;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
@@ -1129,7 +1129,7 @@ lm32_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   htab = lm32_elf_hash_table (info);
@@ -1979,7 +1979,7 @@ lm32_elf_late_size_sections (bfd *output_bfd,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       s = htab->root.sgot;
@@ -2087,12 +2087,12 @@ lm32_elf_late_size_sections (bfd *output_bfd,
                      end = internal_relocs + s->reloc_count;
                      while (internal_relocs < end)
                        {
-                         Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
-                         struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (ibfd);
+                         Elf_Internal_Shdr *symtab_hdr;
+                         struct elf_link_hash_entry **sym_hashes;
                          unsigned long r_symndx;
                          struct elf_link_hash_entry *h;
 
-                         symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+                         symtab_hdr = &elf_symtab_hdr (ibfd);
                          sym_hashes = elf_sym_hashes (ibfd);
                          r_symndx = ELF32_R_SYM (internal_relocs->r_info);
                          h = NULL;
index c6d47afa998fc5c5834aa80fafa4733bdcce6a81..e1308eef58bfa57cf8b8c5791a8464a85faab7b3 100644 (file)
@@ -405,7 +405,7 @@ m32c_elf_relocate_section
   Elf_Internal_Rela *          relend;
   asection *splt;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -668,7 +668,7 @@ m32c_elf_check_relocs
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   local_plt_offsets = elf_local_got_offsets (abfd);
   splt = NULL;
@@ -979,7 +979,7 @@ dump_symtab (bfd * abfd, void *internal_syms, void *external_syms)
       free_external = 1;
     }
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   locsymcount = symtab_hdr->sh_size / get_elf_backend_data(abfd)->s->sizeof_sym;
   if (free_internal)
     isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
@@ -1188,7 +1188,7 @@ m32c_elf_relax_plt_section (asection *splt,
       if (! local_plt_offsets)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       if (symtab_hdr->sh_info != 0)
        {
          isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -1255,7 +1255,7 @@ m32c_elf_relax_plt_section (asection *splt,
       for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
        {
          bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
-         unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info;
+         unsigned int nlocals = elf_symtab_hdr (ibfd).sh_info;
          unsigned int idx;
 
          if (! local_plt_offsets)
@@ -2034,7 +2034,7 @@ m32c_elf_relax_delete_bytes (bfd *abfd,
     }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   intsyms = (Elf_Internal_Sym *) symtab_hdr->contents;
   isym = intsyms;
   isymend = isym + symtab_hdr->sh_info;
index 26edbc0ecfdf8918abf0365b87a15659c8ee7934..c10195b154d00deec2374b7cf7f7f096a1e5bd91 100644 (file)
@@ -2083,7 +2083,7 @@ m32r_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       s = htab->sgot;
@@ -2210,7 +2210,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                           Elf_Internal_Sym *local_syms,
                           asection **local_sections)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (input_bfd);
   struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
   Elf_Internal_Rela *rel, *relend;
   /* Assume success.  */
@@ -3403,7 +3403,7 @@ m32r_elf_check_relocs (bfd *abfd,
     return true;
 
   sreloc = NULL;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   htab = m32r_elf_hash_table (info);
index c5df6e0df64e11aeed97a440d64193392d8058a4..d3e67b900ef517448116f6f50d4a021704461e15 100644 (file)
@@ -715,7 +715,7 @@ m68hc11_elf_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -1135,7 +1135,7 @@ m68hc11_elf_relax_delete_bytes (bfd *abfd, asection *sec,
   struct elf_link_hash_entry **end_hashes;
   unsigned int symcount;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
 
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
index e90b307c8e4b67f3d878b752b141d5e9935ba71b..d1adb328c193ccf076b643b6453e825b985ce9cf 100644 (file)
@@ -365,7 +365,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
       Elf_Internal_Shdr *symtab_hdr;
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
@@ -398,7 +398,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
       sym_hashes = elf_sym_hashes (input_bfd);
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
@@ -856,7 +856,7 @@ elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   rel_end = relocs + sec->reloc_count;
 
@@ -939,7 +939,7 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   struct m68hc11_elf_link_hash_table *htab;
   unsigned long e_flags;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   e_flags = elf_elfheader (input_bfd)->e_flags;
 
index 6c9f7e12bd980cc988319bcdf0447a8772e583df..e90ba0864544ab939e7d83d7b5306bda0e9a0b91 100644 (file)
@@ -2574,7 +2574,7 @@ elf_m68k_check_relocs (bfd *abfd,
     return true;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   sreloc = NULL;
@@ -3441,7 +3441,7 @@ elf_m68k_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   sgot = NULL;
@@ -4390,7 +4390,7 @@ bfd_m68k_elf32_create_embedded_relocs (bfd *abfd, struct bfd_link_info *info,
   if (datasec->reloc_count == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
index bbdb83cb11b6e242548429f848605f70d6795286..ddf29edaf6b1ca35c36a687f0c4b6aabc8d139a3 100644 (file)
@@ -399,7 +399,7 @@ mcore_elf_relocate_section (bfd * output_bfd,
                            Elf_Internal_Sym * local_syms,
                            asection ** local_sections)
 {
-  Elf_Internal_Shdr * symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  Elf_Internal_Shdr * symtab_hdr = &elf_symtab_hdr (input_bfd);
   struct elf_link_hash_entry ** sym_hashes = elf_sym_hashes (input_bfd);
   Elf_Internal_Rela * rel = relocs;
   Elf_Internal_Rela * relend = relocs + input_section->reloc_count;
@@ -594,7 +594,7 @@ mcore_elf_check_relocs (bfd * abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
index 3516c9867d8f628253b35b2f01541a38585953fe..18b1be588883e832dd16af4f8c97060a61adc80b 100644 (file)
@@ -440,7 +440,7 @@ mep_elf_relocate_section
   Elf_Internal_Rela *          rel;
   Elf_Internal_Rela *          relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
index c17797278a777dba21c94bb05230a3ffa6231c86..ee0d19b08b98c985ddcf12a2401e84779ba7392a 100644 (file)
@@ -921,7 +921,7 @@ metag_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
    bfd_hash_lookup ((table), (string), (create), (copy)))
 
 #define metag_elf_local_got_tls_type(abfd) \
-  ((char *)(elf_local_got_offsets (abfd) + (elf_tdata (abfd)->symtab_hdr.sh_info)))
+  ((char *)(elf_local_got_offsets (abfd) + elf_symtab_hdr (abfd).sh_info))
 
 /* Assorted hash table functions.  */
 
@@ -1431,7 +1431,7 @@ elf_metag_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *relend;
   asection *sreloc;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   eh_syms = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
@@ -2038,7 +2038,7 @@ elf_metag_check_relocs (bfd *abfd,
 
   htab = metag_link_hash_table (info);
   dynobj = htab->etab.dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   eh_syms = elf_sym_hashes (abfd);
   sreloc = NULL;
 
@@ -2752,7 +2752,7 @@ elf_metag_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       local_tls_type = metag_elf_local_got_tls_type (ibfd);
@@ -3595,7 +3595,7 @@ get_local_syms (bfd *output_bfd ATTRIBUTE_UNUSED, bfd *input_bfd,
       Elf_Internal_Shdr *symtab_hdr;
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
@@ -3694,7 +3694,7 @@ elf_metag_size_stubs(bfd *output_bfd, bfd *stub_bfd,
          Elf_Internal_Sym *local_syms;
 
          /* We'll need the symbol table in a second.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info == 0)
            continue;
 
index 1b6df83fa3897d50b798403e0a1b843b5af9bad2..2f8167c4d9c0ca9fef855710b506a8d7367471cc 100644 (file)
@@ -967,7 +967,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                                 asection **local_sections)
 {
   struct elf32_mb_link_hash_table *htab;
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (input_bfd);
   struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
   Elf_Internal_Rela *rel, *relend;
   int endian = (bfd_little_endian (output_bfd)) ? 0 : 2;
@@ -1796,7 +1796,7 @@ microblaze_elf_relax_section (bfd *abfd,
     sec->size = sec->rawsize;
 
   /* Get symbols for this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
   symcount =  symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
   if (isymbuf == NULL)
@@ -2385,7 +2385,7 @@ microblaze_elf_check_relocs (bfd * abfd,
   if (htab == NULL)
     return false;
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -3016,7 +3016,7 @@ microblaze_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       lgot_masks = (unsigned char *) end_local_got;
index 7825c2f85ef230d250c82e54877ee758eef49ac7..cd2114b6944f3b12a2fc4bd5849358d7b6244891 100644 (file)
@@ -212,7 +212,7 @@ moxie_elf_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -329,7 +329,7 @@ moxie_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
index bf85349ad73a38ca396169ee2de28385d3501a22..065efc4fa83f380c55037ee1629c30a19bb6dc06 100644 (file)
@@ -770,7 +770,7 @@ elf32_msp430_check_relocs (bfd * abfd, struct bfd_link_info * info,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -1428,7 +1428,7 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
@@ -1728,7 +1728,7 @@ msp430_elf_symbol_address_p (bfd * abfd,
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
   /* Examine all the local symbols.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     if (isym->st_shndx == sec_shndx && isym->st_value == addr)
       return true;
@@ -1769,7 +1769,7 @@ msp430_elf_relax_adjust_locals (bfd * abfd, asection * sec, bfd_vma addr,
     return true;
 
   irelend = irel + sec->reloc_count;
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
 
   for (;irel < irelend; irel++)
@@ -1824,7 +1824,7 @@ msp430_elf_relax_delete_bytes (bfd * abfd, asection * sec, bfd_vma addr,
   sec->size -= count;
 
   /* Adjust all the relocs.  */
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (; irel < irelend; irel++)
     {
@@ -1837,7 +1837,7 @@ msp430_elf_relax_delete_bytes (bfd * abfd, asection * sec, bfd_vma addr,
     msp430_elf_relax_adjust_locals (abfd,p,addr,count,sec_shndx,toaddr);
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     {
@@ -1964,7 +1964,7 @@ msp430_elf_relax_add_words (bfd * abfd, asection * sec, bfd_vma addr,
                                    sec_shndx, sec_end);
 
   /* Adjust the global symbols affected by the move.  */
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     if (isym->st_shndx == sec_shndx
@@ -2027,7 +2027,7 @@ msp430_elf_relax_section (bfd * abfd, asection * sec,
     printf ("Relaxing %s (%p), output_offset: 0x%lx sec size: 0x%lx\n",
            sec->name, sec, (long) sec->output_offset, (long) sec->size);
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs =
index a02fedfa93bd7d2e74f91ac39591f7f2cfe04997..6e81db3ea0bd2f2b5953b93c88461a2de91e935f 100644 (file)
@@ -313,7 +313,7 @@ mt_elf_relocate_section
   Elf_Internal_Rela *          rel;
   Elf_Internal_Rela *          relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -439,7 +439,7 @@ mt_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
index b02dd815d57f3a836fd14b2a092cde8e43a3f796..0f6c676eb946077023f16293f820acb0309a2b3c 100644 (file)
@@ -4428,7 +4428,7 @@ nds32_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       sgot = elf_hash_table (info)->sgot;
@@ -5066,7 +5066,7 @@ nds32_elf_relocate_section (bfd *            output_bfd ATTRIBUTE_UNUSED,
   int eliminate_gc_relocs;
   bfd_vma fpbase_addr;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   ehtab = elf_hash_table (info);
   htab = nds32_elf_hash_table (info);
@@ -7047,7 +7047,7 @@ elf32_nds32_allocate_local_sym_info (bfd *abfd)
       bfd_size_type size;
       char *data;
 
-      num_syms = elf_tdata (abfd)->symtab_hdr.sh_info;
+      num_syms = elf_symtab_hdr (abfd).sh_info;
       /* This space is for got_refcounts, got_tls_type, tlsdesc_gotent, and
         gp_offset.  The details can refer to struct elf_nds32_obj_tdata.  */
       size = num_syms * (sizeof (bfd_signed_vma) + sizeof (char)
@@ -7097,7 +7097,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
       return true;
     }
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   ehtab = elf_hash_table (info);
@@ -8828,7 +8828,7 @@ is_convert_32_to_16 (bfd *abfd, asection *sec,
   else
     return false;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   if (!nds32_get_local_syms (abfd, sec, &isymbuf))
     return false;
 
@@ -9265,7 +9265,7 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec,
   /* The deletion must stop at the next ALIGN reloc for an alignment
      power larger than the number of bytes we are deleting.  */
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   if (!nds32_get_local_syms (abfd, sec, &isym))
     return false;
 
@@ -9570,7 +9570,7 @@ nds32_get_local_syms (bfd *abfd, asection *sec ATTRIBUTE_UNUSED,
                      Elf_Internal_Sym **isymbuf_p)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Read this BFD's local symbols if we haven't done so already.  */
   if (*isymbuf_p == NULL && symtab_hdr->sh_info != 0)
@@ -12225,7 +12225,7 @@ nds32_elf_relax_section (bfd *abfd, asection *sec,
       relax_range_measurement (abfd, link_info);
     }
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   /* Relocations MUST be kept in memory, because relaxation adjust them.  */
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
                                               true /* keep_memory */);
@@ -12910,7 +12910,7 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info,
      To suppress the conversion, we simply NOT to apply
      R_NDS32_INSN16_FP7U2_FLAG flag.  */
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   contents = NULL;
   if (!nds32_get_section_contents (abfd, sec, &contents, true)
@@ -13049,7 +13049,7 @@ nds32_fag_remove_unused_fpbase (bfd *abfd, asection *sec,
        R_NDS32_17IFC_PCREL_RELA
        R_NDS32_10IFCU_PCREL_RELA.  */
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   nds32_get_section_contents (abfd, sec, &contents, true);
 
   for (irel = internal_relocs; irel < irelend; irel++)
@@ -13548,7 +13548,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, asection *insec, bfd_byte *incontents,
 
   relax_group_list_t chain = { .id = -1, .next = NULL, .next_sibling = NULL };
 
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (inbfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (inbfd);
   struct elf_link_hash_entry **sym_hashes;
   sym_hashes = elf_sym_hashes (inbfd);
 
index cb91d631087f4ffb2dfb5b51fb806645f5715ef9..56569435fb7f40aecc3eb1be27cea255b78ca80f 100644 (file)
@@ -1335,7 +1335,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
       got_base = sgot->output_section->vma + sgot->output_offset;
     }
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
@@ -1959,7 +1959,7 @@ or1k_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   htab = or1k_elf_hash_table (info);
@@ -3122,7 +3122,7 @@ or1k_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
       end_local_got = local_got + locsymcount;
       s = htab->root.sgot;
index 75112f9f2a3cc5152191e43f143505ce8fd96ad2..626f794897570a2fbecc7c80f48fa2abbc7f2c73 100644 (file)
@@ -697,7 +697,7 @@ pru_elf32_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *relend;
   bool is_rel_reloc;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
@@ -1134,7 +1134,7 @@ pru_elf_relax_delete_bytes (bfd *abfd,
   struct elf_link_hash_entry **end_hashes;
   unsigned int symcount;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
   contents = elf_section_data (sec)->this_hdr.contents;
 
@@ -1361,7 +1361,7 @@ pru_elf32_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
index 583b5a7f0e8e3c9288abbc474b3ed4724a44cc72..2c83214a912db5b104bacedf9ce962db840c2677 100644 (file)
@@ -718,7 +718,7 @@ rl78_elf_relocate_section
   asection *splt;
   bool ret;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
@@ -1327,7 +1327,7 @@ rl78_elf_check_relocs
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   local_plt_offsets = elf_local_got_offsets (abfd);
   dynobj = elf_hash_table(info)->dynobj;
@@ -1570,7 +1570,7 @@ rl78_elf_relax_plt_section (bfd *dynobj,
       if (! local_plt_offsets)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       if (symtab_hdr->sh_info != 0)
        {
          isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -1637,7 +1637,7 @@ rl78_elf_relax_plt_section (bfd *dynobj,
       for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
        {
          bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
-         unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info;
+         unsigned int nlocals = elf_symtab_hdr (ibfd).sh_info;
          unsigned int idx;
 
          if (! local_plt_offsets)
@@ -1726,7 +1726,7 @@ elf32_rl78_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count
     }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   isymend = isym + symtab_hdr->sh_info;
 
index 5aadc16770945dc17ce2be6e64d02fff4dc34426..3f26d7684f9d8345a49293953e9e26125c1a93b0 100644 (file)
@@ -518,7 +518,7 @@ rx_elf_relocate_section
   else
     pid_mode = false;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
   for (rel = relocs; rel < relend; rel ++)
@@ -1638,7 +1638,7 @@ elf32_rx_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count,
     }
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   isymend = isym + symtab_hdr->sh_info;
 
@@ -3358,7 +3358,7 @@ rx_dump_symtab (bfd * abfd, void * internal_syms, void * external_syms)
   char * st_other_str;
   char * st_shndx_str;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   locsymcount = symtab_hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym;
   if (!internal_syms)
     isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
index b21992a4a6bcf0b20efea6f90af0d069a7251136..1b3a1cc5dff577c5dc5f00f199959f1052b92384 100644 (file)
@@ -1234,7 +1234,7 @@ score_elf_local_relocation_p (bfd *input_bfd,
   size_t extsymoff;
 
   r_symndx = ELF32_R_SYM (relocation->r_info);
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
 
   if (r_symndx < extsymoff)
@@ -2445,7 +2445,7 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
        return false;
     }
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
   rel = relocs;
   relend = relocs + input_section->reloc_count;
@@ -2800,7 +2800,7 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
     return true;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info;
 
index e0220a27f8b3ddd5ded23d9ad14327664971063a..6bccccc6f67c4df0df78d5a4637ac9b759ea1c65 100644 (file)
@@ -1092,7 +1092,7 @@ score_elf_local_relocation_p (bfd *input_bfd,
   size_t extsymoff;
 
   r_symndx = ELF32_R_SYM (relocation->r_info);
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
 
   if (r_symndx < extsymoff)
@@ -2287,7 +2287,7 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
        return false;
     }
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
   rel = relocs;
   relend = relocs + input_section->reloc_count;
@@ -2607,7 +2607,7 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
     return true;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info;
 
index 4a2af62e082665c7564f7282cbed8934097b21ac..5f547b65443c91caa9a6680b38f6e3d60eeb04a5 100644 (file)
@@ -500,7 +500,7 @@ get_sym_h (struct elf_link_hash_entry **hp,
           unsigned long r_symndx,
           bfd *ibfd)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd);
 
   if (r_symndx >= symtab_hdr->sh_info)
     {
@@ -1018,7 +1018,7 @@ needs_ovl_stub (struct elf_link_hash_entry *h,
              else
                {
                  Elf_Internal_Shdr *symtab_hdr;
-                 symtab_hdr = &elf_tdata (input_section->owner)->symtab_hdr;
+                 symtab_hdr = &elf_symtab_hdr (input_section->owner);
                  sym_name = bfd_elf_sym_name (input_section->owner,
                                               symtab_hdr,
                                               sym,
@@ -1096,7 +1096,7 @@ count_stub (struct spu_link_hash_table *htab,
     {
       if (elf_local_got_ents (ibfd) == NULL)
        {
-         bfd_size_type amt = (elf_tdata (ibfd)->symtab_hdr.sh_info
+         bfd_size_type amt = (elf_symtab_hdr (ibfd).sh_info
                               * sizeof (*elf_local_got_ents (ibfd)));
          elf_local_got_ents (ibfd) = bfd_zmalloc (amt);
          if (elf_local_got_ents (ibfd) == NULL)
@@ -1552,7 +1552,7 @@ process_stubs (struct bfd_link_info *info, bool build)
        continue;
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
@@ -2509,7 +2509,7 @@ func_name (struct function_info *fun)
       return name;
     }
   ibfd = sec->owner;
-  symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (ibfd);
   return bfd_elf_sym_name (ibfd, symtab_hdr, fun->u.sym, sec);
 }
 
@@ -2711,7 +2711,7 @@ mark_functions_via_relocs (asection *sec,
   if (internal_relocs == NULL)
     return false;
 
-  symtab_hdr = &elf_tdata (sec->owner)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (sec->owner);
   psyms = &symtab_hdr->contents;
   irela = internal_relocs;
   irelaend = irela + sec->reloc_count;
@@ -2999,7 +2999,7 @@ discover_functions (struct bfd_link_info *info)
        continue;
 
       /* Read all the symbols.  */
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
       if (symcount == 0)
        {
@@ -3117,7 +3117,7 @@ discover_functions (struct bfd_link_info *info)
 
          psecs = sec_arr[bfd_idx];
 
-         symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (ibfd);
          syms = (Elf_Internal_Sym *) symtab_hdr->contents;
 
          gaps = false;
@@ -4848,7 +4848,7 @@ spu_elf_relocate_section (bfd *output_bfd,
           && maybe_needs_stubs (input_section));
   iovl = overlay_index (input_section);
   ea = bfd_get_section_by_name (output_bfd, "._ea");
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = (struct elf_link_hash_entry **) (elf_sym_hashes (input_bfd));
 
   rel = relocs;
index 3b2e01757d531d10a9249bbbc99a7424b6bfff5c..d5a13066a2da3d014a5edb5d02b1d8148fad66be 100644 (file)
@@ -1404,7 +1404,7 @@ tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
     return true;
 
   htab = tilepro_elf_hash_table (info);
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   sreloc = NULL;
index 15acc25ac357cc5f8faca4b40e050b42c26fce63..e625f9d3f68cfe2e7d1d66133fdb80017b37e946 100644 (file)
@@ -66,7 +66,7 @@ v850_elf_check_relocs (bfd *abfd,
                      sec, abfd);
 #endif
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -2185,7 +2185,7 @@ v850_elf_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   /* Reset the list of remembered HI16S relocs to empty.  */
@@ -3210,7 +3210,7 @@ v850_elf_relax_delete_bytes (bfd *abfd,
   struct elf_link_hash_entry *sym_hash;
   Elf_External_Sym_Shndx *shndx;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
 
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
@@ -3450,7 +3450,7 @@ v850_elf_relax_section (bfd *abfd,
       || sec->reloc_count == 0)
     return true;
 
-  symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   internal_relocs = (_bfd_elf_link_read_relocs
                     (abfd, sec, NULL, NULL, link_info->keep_memory));
index c7ba7713b87b85d3f33e2b7ae93088f35c9369be..6c278d4656678464fe2554076c746db68da9ce7b 100644 (file)
@@ -565,7 +565,7 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
     return true;
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   sreloc = NULL;
@@ -1220,7 +1220,7 @@ elf_vax_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   sgot = NULL;
index 7f28c81fda34dafdebd334b279e7634af25974ad..f6c988dae70f616f75032e357040163e892ac85b 100644 (file)
@@ -505,7 +505,7 @@ visium_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -561,7 +561,7 @@ visium_elf_relocate_section (bfd *output_bfd,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
index 5126a31cdb5816d6e016227c4f152a956c95d150..004db71968b909279df802da0a8103a956757d2e 100644 (file)
@@ -422,7 +422,7 @@ xstormy16_elf_check_relocs (bfd *abfd,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata(abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   local_plt_offsets = elf_local_got_offsets (abfd);
   dynobj = elf_hash_table(info)->dynobj;
@@ -620,7 +620,7 @@ xstormy16_elf_relax_section (bfd *dynobj,
       if (! local_plt_offsets)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       if (symtab_hdr->sh_info != 0)
        {
          isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -687,7 +687,7 @@ xstormy16_elf_relax_section (bfd *dynobj,
       for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next)
        {
          bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd);
-         unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info;
+         unsigned int nlocals = elf_symtab_hdr (ibfd).sh_info;
          unsigned int idx;
 
          if (! local_plt_offsets)
@@ -776,7 +776,7 @@ xstormy16_elf_relocate_section (bfd *                       output_bfd ATTRIBUTE_UNUSED,
   Elf_Internal_Rela *          relend;
   asection *splt;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
index 8a1e2e064ea3e0d9478c96101342eb7fb3d14db9..08ea42e3c2dcd0fe6ba62af53300f77b80fa4275 100644 (file)
@@ -1063,7 +1063,7 @@ elf_xtensa_check_relocs (bfd *abfd,
   if (htab == NULL)
     return false;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   rel_end = relocs + sec->reloc_count;
@@ -1528,7 +1528,7 @@ elf_xtensa_allocate_local_got_size (struct bfd_link_info *info)
       if (!local_got_refcounts)
        continue;
 
-      symtab_hdr = &elf_tdata (i)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (i);
       cnt = symtab_hdr->sh_info;
 
       for (j = 0; j < cnt; ++j)
@@ -2525,7 +2525,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
   if (htab == NULL)
     return false;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   local_got_tls_types = elf_xtensa_local_got_tls_type (input_bfd);
 
@@ -6824,7 +6824,7 @@ retrieve_local_syms (bfd *input_bfd)
   Elf_Internal_Sym *isymbuf;
   size_t locsymcount;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   locsymcount = symtab_hdr->sh_info;
 
   isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
@@ -10232,7 +10232,7 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info,
   if (htab == NULL)
     return;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   r_type = ELF32_R_TYPE (rel->r_info);
@@ -10817,7 +10817,7 @@ relax_section_symbols (bfd *abfd, asection *sec)
 
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isymbuf = retrieve_local_syms (abfd);
 
   num_syms = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
@@ -11004,7 +11004,7 @@ elf_xtensa_get_gotplt_section (struct bfd_link_info *info, int chunk)
 static asection *
 get_elf_r_symndx_section (bfd *abfd, unsigned long r_symndx)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   asection *target_sec = NULL;
   if (r_symndx < symtab_hdr->sh_info)
     {
@@ -11059,7 +11059,7 @@ get_elf_r_symndx_hash_entry (bfd *abfd, unsigned long r_symndx)
 {
   unsigned long indx;
   struct elf_link_hash_entry *h;
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
 
   if (r_symndx < symtab_hdr->sh_info)
     return NULL;
@@ -11078,7 +11078,7 @@ get_elf_r_symndx_hash_entry (bfd *abfd, unsigned long r_symndx)
 static bfd_vma
 get_elf_r_symndx_offset (bfd *abfd, unsigned long r_symndx)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   bfd_vma offset = 0;
 
   if (r_symndx < symtab_hdr->sh_info)
index dcad50717b6f17c7377eaa420bded9bfd5ed71c8..8eacfd7e4640d76053bd0f330b11bbee09a752cd 100644 (file)
@@ -397,7 +397,7 @@ z80_elf_relocate_section (bfd *output_bfd,
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *relend;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
 
   rel = relocs;
index 199505d17a5f8c5b40331c214e8431624a2f9697..f28b9b602658234f31b1b10923ebe01b56b81a59 100644 (file)
@@ -1675,7 +1675,7 @@ get_got_entry (bfd *abfd, struct alpha_elf_link_hash_entry *h,
          bfd_size_type size;
          Elf_Internal_Shdr *symtab_hdr;
 
-         symtab_hdr = &elf_tdata(abfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (abfd);
          size = symtab_hdr->sh_info;
          size *= sizeof (struct alpha_elf_got_entry *);
 
@@ -2187,7 +2187,7 @@ elf64_alpha_can_merge_gots (bfd *a, bfd *b)
   for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next)
     {
       struct alpha_elf_link_hash_entry **hashes = alpha_elf_sym_hashes (bsub);
-      Elf_Internal_Shdr *symtab_hdr = &elf_tdata (bsub)->symtab_hdr;
+      Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (bsub);
       int i, n;
 
       n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info;
@@ -2251,7 +2251,7 @@ elf64_alpha_merge_gots (bfd *a, bfd *b)
       local_got_entries = alpha_elf_tdata (bsub)->local_got_entries;
       if (local_got_entries)
        {
-         n = elf_tdata (bsub)->symtab_hdr.sh_info;
+         n = elf_symtab_hdr (bsub).sh_info;
          for (i = 0; i < n; ++i)
            {
              struct alpha_elf_got_entry *ent;
@@ -2262,7 +2262,7 @@ elf64_alpha_merge_gots (bfd *a, bfd *b)
 
       /* Merge the global .got entries.  */
       hashes = alpha_elf_sym_hashes (bsub);
-      symtab_hdr = &elf_tdata (bsub)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (bsub);
 
       n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info;
       for (i = 0; i < n; ++i)
@@ -2382,7 +2382,7 @@ elf64_alpha_calc_got_offsets (struct bfd_link_info *info)
          if (!local_got_entries)
            continue;
 
-         for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k)
+         for (k = 0, n = elf_symtab_hdr (j).sh_info; k < n; ++k)
            for (gotent = local_got_entries[k]; gotent; gotent = gotent->next)
              if (gotent->use_count > 0)
                {
@@ -2762,7 +2762,7 @@ elf64_alpha_size_rela_got_section (struct bfd_link_info *info)
          if (!local_got_entries)
            continue;
 
-         for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k)
+         for (k = 0, n = elf_symtab_hdr (j).sh_info; k < n; ++k)
            for (gotent = local_got_entries[k];
                 gotent ; gotent = gotent->next)
              if (gotent->use_count > 0)
index dda21f7674b42284b963a0e64697a58d26d66747..89ab8ab80c8c817dbb12d75625ab08787947282e 100644 (file)
@@ -186,7 +186,7 @@ bpf_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
index 38558abe9c2c468d3007b0d1d7c71f53b6691c92..655b0aec0c1ccbc2bddd9339da94fb1101792d62 100644 (file)
@@ -470,7 +470,7 @@ count_dyn_reloc (bfd *abfd,
 static bfd_signed_vma *
 hppa64_elf_local_refcounts (bfd *abfd)
 {
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   bfd_signed_vma *local_refcounts;
 
   local_refcounts = elf_local_got_refcounts (abfd);
@@ -519,7 +519,7 @@ elf64_hppa_check_relocs (bfd *abfd,
   hppa_info = hppa_link_hash_table (info);
   if (hppa_info == NULL)
     return false;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* If necessary, build a new table holding section symbols indices
      for this BFD.  */
@@ -1731,7 +1731,7 @@ elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
       if (!start_local_dlt)
        continue;
 
-      symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (ibfd);
       locsymcount = symtab_hdr->sh_info;
 
       end_local_dlt = start_local_dlt + locsymcount;
@@ -3489,7 +3489,7 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel,
   if (hppa_info == NULL)
     return bfd_reloc_notsupported;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   local_offsets = elf_local_got_offsets (input_bfd);
   insn = bfd_get_32 (input_bfd, hit_data);
 
@@ -4302,7 +4302,7 @@ elf64_hppa_relocate_section (bfd *output_bfd,
   if (hppa_info == NULL)
     return false;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   rel = relocs;
   relend = relocs + input_section->reloc_count;
index 54735559ef8763cf19291af6426b6043cae1e10c..c35cb7cedc5e537e6141a00b4f90058b783b74c6 100644 (file)
@@ -381,7 +381,7 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec,
   if (ia64_info == NULL)
     return false;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Load the relocations for this section.  */
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -1930,7 +1930,7 @@ elf64_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   ia64_info = elf64_ia64_hash_table (info);
   if (ia64_info == NULL)
     return false;
@@ -3385,7 +3385,7 @@ elf64_ia64_relocate_section (bfd *output_bfd,
   bool ret_val = true; /* for non-fatal errors */
   bfd_vma gp_val;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   ia64_info = elf64_ia64_hash_table (info);
   if (ia64_info == NULL)
     return false;
@@ -4881,7 +4881,7 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
         This should be harmless and shouldn't happen in practice.  */
     }
 
-  hdr = &elf_tdata (abfd)->symtab_hdr;
+  hdr = &elf_symtab_hdr (abfd);
   symcount = hdr->sh_size / bed->s->sizeof_sym;
 
   /* The sh_info field of the symtab header tells us where the
index 63ae1076916441eef62d77854d131e80b92ac6bc..b874fae40afd564d9b2e6d4ecee971be266f5d08 100644 (file)
@@ -1364,7 +1364,7 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
   size_t pjsno = 0;
 
   size = input_section->rawsize ? input_section->rawsize : input_section->size;
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   sym_hashes = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
@@ -1953,7 +1953,7 @@ mmix_elf_check_relocs (bfd *abfd,
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   /* First we sort the relocs so that any register relocs come before
@@ -2547,7 +2547,7 @@ mmix_elf_relax_section (bfd *abfd,
          && mmix_elf_section_data (sec)->pjs.n_pushj_relocs == 0))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   if (bpodata != NULL)
     {
index 9e4ff80a02c55005c2ac6ce89e231efb29ee7ef6..5eae7f92d14a7d8a43cacbd3118775f901c30014 100644 (file)
@@ -1268,7 +1268,7 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bool dynamic)
 
   if (! dynamic)
     {
-      hdr = &elf_tdata (abfd)->symtab_hdr;
+      hdr = &elf_symtab_hdr (abfd);
       verhdr = NULL;
       symcount = hdr->sh_size / ebd->s->sizeof_sym;
     }
index 197c57595274b921df34e4bef2db5ec8db11ed60..a6cada099f0a36820602408568836ccb0c01315e 100644 (file)
@@ -139,7 +139,7 @@ _bfd_get_local_sym_section (struct elf_reloc_cookie *cookie,
   bfd *abfd = cookie->abfd;
   if (elf_loc_shndx (abfd) == NULL)
     {
-      Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+      Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
       Elf_Internal_Sym *locsyms = bfd_elf_get_elf_syms (abfd, symtab_hdr,
                                                        cookie->locsymcount, 0,
                                                        NULL, NULL, NULL);
@@ -877,7 +877,7 @@ bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *info,
     return 0;
 
   /* Go find the symbol, so that we can find it's name.  */
-  if (!bfd_elf_get_elf_syms (input_bfd, &elf_tdata (input_bfd)->symtab_hdr,
+  if (!bfd_elf_get_elf_syms (input_bfd, &elf_symtab_hdr (input_bfd),
                             1, input_indx, &entry->isym, esym, &eshndx))
     {
       bfd_release (input_bfd, entry);
@@ -900,7 +900,7 @@ bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *info,
     }
 
   name = (bfd_elf_string_from_elf_section
-         (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link,
+         (input_bfd, elf_symtab_hdr (input_bfd).sh_link,
           entry->isym.st_name));
 
   dynstr = elf_hash_table (info)->dynstr;
@@ -2820,7 +2820,7 @@ elf_link_read_relocs_from_section (bfd *abfd,
                                 external_relocs_addr, abfd, true))
     return false;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   nsyms = NUM_SHDR_ENTRIES (symtab_hdr);
 
   bed = get_elf_backend_data (abfd);
@@ -3726,7 +3726,7 @@ elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef)
       /* Use the IR symbol table if the object has been claimed by
         plugin.  */
       abfd = abfd->plugin_dummy_bfd;
-      hdr = &elf_tdata (abfd)->symtab_hdr;
+      hdr = &elf_symtab_hdr (abfd);
     }
   else
     {
@@ -3737,7 +3737,7 @@ elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef)
        }
 
       if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0)
-       hdr = &elf_tdata (abfd)->symtab_hdr;
+       hdr = &elf_symtab_hdr (abfd);
       else
        hdr = &elf_tdata (abfd)->dynsymtab_hdr;
     }
@@ -4822,7 +4822,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
      look at .symtab for a dynamic object.  */
 
   if (! dynamic || elf_dynsymtab (abfd) == 0)
-    hdr = &elf_tdata (abfd)->symtab_hdr;
+    hdr = &elf_symtab_hdr (abfd);
   else
     hdr = &elf_tdata (abfd)->dynsymtab_hdr;
 
@@ -8767,9 +8767,9 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2,
 
   bed1 = get_elf_backend_data (bfd1);
   bed2 = get_elf_backend_data (bfd2);
-  hdr1 = &elf_tdata (bfd1)->symtab_hdr;
+  hdr1 = &elf_symtab_hdr (bfd1);
   symcount1 = hdr1->sh_size / bed1->s->sizeof_sym;
-  hdr2 = &elf_tdata (bfd2)->symtab_hdr;
+  hdr2 = &elf_symtab_hdr (bfd2);
   symcount2 = hdr2->sh_size / bed2->s->sizeof_sym;
 
   if (symcount1 == 0 || symcount2 == 0)
@@ -9200,7 +9200,7 @@ resolve_symbol (const char *name,
   Elf_Internal_Shdr *symtab_hdr;
   size_t i;
 
-  symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
 
   for (i = 0; i < locsymcount; ++ i)
     {
@@ -10524,7 +10524,7 @@ elf_link_swap_symbols_out (struct elf_final_link_info *flinfo)
                                         elfsym->dest_index));
     }
 
-  hdr = &elf_tdata (flinfo->output_bfd)->symtab_hdr;
+  hdr = &elf_symtab_hdr (flinfo->output_bfd);
   pos = hdr->sh_offset + hdr->sh_size;
   amt = bed->s->sizeof_sym * flinfo->output_bfd->symcount;
   if (bfd_seek (flinfo->output_bfd, pos, SEEK_SET) == 0
@@ -12849,10 +12849,10 @@ _bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
                  /* We are interested in just local symbols, not all
                     symbols.  */
                  if (elf_bad_symtab (sec->owner))
-                   sym_count = (elf_tdata (sec->owner)->symtab_hdr.sh_size
+                   sym_count = (elf_symtab_hdr (sec->owner).sh_size
                                 / bed->s->sizeof_sym);
                  else
-                   sym_count = elf_tdata (sec->owner)->symtab_hdr.sh_info;
+                   sym_count = elf_symtab_hdr (sec->owner).sh_info;
 
                  if (sym_count > max_sym_count)
                    max_sym_count = sym_count;
@@ -13008,7 +13008,7 @@ _bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
      the .symtab section at the current file position, and write directly to it.
      We build the .strtab section in memory.  */
   abfd->symcount = 0;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   /* sh_name is set in prep_headers.  */
   symtab_hdr->sh_type = SHT_SYMTAB;
   /* sh_flags, sh_addr and sh_size all start off zero.  */
@@ -13905,7 +13905,7 @@ init_reloc_cookie (struct elf_reloc_cookie *cookie, bfd *abfd)
   elf_backend_data *bed;
 
   bed = get_elf_backend_data (abfd);
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   cookie->abfd = abfd;
   cookie->num_sym = symtab_hdr->sh_size / bed->s->sizeof_sym;
@@ -14815,9 +14815,9 @@ bfd_elf_gc_record_vtinherit (bfd *abfd,
   /* The sh_info field of the symtab header tells us where the
      external symbols start.  We don't care about the local symbols at
      this point.  */
-  extsymcount = elf_tdata (abfd)->symtab_hdr.sh_size / bed->s->sizeof_sym;
+  extsymcount = elf_symtab_hdr (abfd).sh_size / bed->s->sizeof_sym;
   if (!elf_bad_symtab (abfd))
-    extsymcount -= elf_tdata (abfd)->symtab_hdr.sh_info;
+    extsymcount -= elf_symtab_hdr (abfd).sh_info;
 
   sym_hashes = elf_sym_hashes (abfd);
   sym_hashes_end = PTR_ADD (sym_hashes, extsymcount);
@@ -15101,7 +15101,7 @@ bfd_elf_gc_common_finalize_got_offsets (bfd *abfd,
       if (!local_got)
        continue;
 
-      symtab_hdr = &elf_tdata (i)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (i);
       if (elf_bad_symtab (i))
        locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym;
       else
index 117e149866cf8737b3e742678a57d70d40a9f935..6c004dbceb7f7543a62e03f7cdd17cdbb86d78ee 100644 (file)
@@ -4383,7 +4383,7 @@ _bfd_aarch64_add_call_stub_entries (bool *stub_changed, bfd *output_bfd,
        continue;
 
       /* We'll need the symbol table in a second.  */
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (symtab_hdr->sh_info == 0)
        continue;
 
index 03a31f41beb231d9f765b820a5c7dab35ba6717c..7fbb070f5c1c19f0c4db893d913efd8a90e39200 100644 (file)
@@ -381,7 +381,7 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
   if (ia64_info == NULL)
     return false;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Load the relocations for this section.  */
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -2173,7 +2173,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
   if (bfd_link_relocatable (info))
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   ia64_info = elfNN_ia64_hash_table (info);
   if (ia64_info == NULL)
     return false;
@@ -2703,7 +2703,7 @@ global_sym_index (struct elf_link_hash_entry *h)
   for (p = elf_sym_hashes (obj); *p != h; ++p)
     continue;
 
-  return p - elf_sym_hashes (obj) + elf_tdata (obj)->symtab_hdr.sh_info;
+  return p - elf_sym_hashes (obj) + elf_symtab_hdr (obj).sh_info;
 }
 
 /* Allocate function descriptors.  We can do these for every function
@@ -3777,7 +3777,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
   bool ret_val = true; /* for non-fatal errors */
   bfd_vma gp_val;
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   ia64_info = elfNN_ia64_hash_table (info);
   if (ia64_info == NULL)
     return false;
index e091c8c3a65d062fd72a63363d7cd8cac17efc01..e40bd3e8a6ec399b5ed226b11a96b187ecae253a 100644 (file)
@@ -1317,7 +1317,7 @@ elfNN_kvx_size_stubs (bfd *output_bfd,
            continue;
 
          /* We'll need the symbol table in a second.  */
-         symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+         symtab_hdr = &elf_symtab_hdr (input_bfd);
          if (symtab_hdr->sh_info == 0)
            continue;
 
index 20b2341d583f472a615144a098a2e56de7b97de9..8f8ec3b07899b3bedc2e412fc442abdcd11dbe02 100644 (file)
@@ -701,7 +701,7 @@ loongarch_elf_record_tls_and_got_reference (bfd *abfd,
                                            bool with_relax_reloc)
 {
   struct loongarch_elf_link_hash_table *htab = loongarch_elf_hash_table (info);
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* This is a global offset table entry for a local symbol.  */
   if (elf_local_got_refcounts (abfd) == NULL)
@@ -1113,7 +1113,7 @@ loongarch_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
     return true;
 
   htab = loongarch_elf_hash_table (info);
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   if (htab->elf.dynobj == NULL)
@@ -5267,7 +5267,7 @@ loongarch_relax_perform_deletes (bfd *abfd, asection *sec,
   unsigned int i, symcount;
   bfd_vma toaddr = sec->size;
   struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd);
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   unsigned int sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
   struct bfd_elf_section_data *data = elf_section_data (sec);
   bfd_byte *contents = data->this_hdr.contents, *contents_end = NULL;
index 97b469bd7db217f4ff8ad85ca56e44d0be02de84..eb3d7926c262ee988f77334b165a3d5018fcd075 100644 (file)
@@ -875,7 +875,7 @@ riscv_elf_record_got_reference (bfd *abfd, struct bfd_link_info *info,
                                struct elf_link_hash_entry *h, long symndx)
 {
   struct riscv_elf_link_hash_table *htab = riscv_elf_hash_table (info);
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
 
   if (htab->elf.sgot == NULL)
     {
@@ -938,7 +938,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
     return true;
 
   htab = riscv_elf_hash_table (info);
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   if (htab->elf.dynobj == NULL)
@@ -4661,7 +4661,7 @@ _riscv_relax_delete_bytes (bfd *abfd,
 {
   unsigned int i, symcount;
   struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd);
-  Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd);
   unsigned int sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
   struct bfd_elf_section_data *data = elf_section_data (sec);
   bfd_byte *contents = data->this_hdr.contents;
index f5e10d1d19a33e0506ed242496425fbf53713ac3..83fdf96a8a5aad223f5841289e4412de8ef9e6da 100644 (file)
@@ -5223,7 +5223,7 @@ mips_elf_local_relocation_p (bfd *input_bfd,
   size_t extsymoff;
 
   r_symndx = ELF_R_SYM (input_bfd, relocation->r_info);
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
 
   if (r_symndx < extsymoff)
@@ -5596,7 +5596,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
 
   /* Figure out whether or not the symbol is local, and get the offset
      used in the array of hash table entries.  */
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (input_bfd);
   local_p = mips_elf_local_relocation_p (input_bfd, relocation,
                                         local_sections);
   was_local_p = local_p;
@@ -8518,7 +8518,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
   BFD_ASSERT (htab != NULL);
 
   dynobj = elf_hash_table (info)->dynobj;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   extsymoff = (elf_bad_symtab (abfd)) ? 0 : symtab_hdr->sh_info;
 
@@ -10536,7 +10536,7 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
       howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, r_type, !rel_reloc);
 
       r_symndx = ELF_R_SYM (input_bfd, rel->r_info);
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      symtab_hdr = &elf_symtab_hdr (input_bfd);
       if (mips_elf_local_relocation_p (input_bfd, rel, local_sections))
        {
          sec = local_sections[r_symndx];
@@ -13710,7 +13710,7 @@ mips_elf_relax_delete_bytes (bfd *abfd,
   BFD_ASSERT (count % 2 == 0);
 
   /* Adjust the local symbols defined in this section.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   isym = (Elf_Internal_Sym *) symtab_hdr->contents;
   for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
     if (isym->st_shndx == sec_shndx && isym->st_value > addr)
@@ -14122,7 +14122,7 @@ _bfd_mips_elf_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_CODE) == 0)
     return true;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
index fff2ef8ae447c54c7acfc48983079eee2339b84c..a13791336adf4d47054dd6433d70e973d4eb6586 100644 (file)
@@ -1602,7 +1602,7 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
     return true;
 
   htab = tilegx_elf_hash_table (info);
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
 
   sreloc = NULL;
index 81fd950b64693a9156774b0d986ee2a0fa4e1ad4..e54b23b36f57f933cd1b190af3d5731db5ac6f72 100644 (file)
@@ -1119,7 +1119,7 @@ _bfd_x86_elf_link_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
 
   is_x86_64 = bed->target_id == X86_64_ELF_DATA;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   local_got_offsets = elf_local_got_offsets (abfd);