make more use of elf_symtab_hdr

This is a mostly mechanical replacement of elf_tdata (abfd)->symtab_hdr
with elf_symtab_hdr (abfd).
This commit is contained in:
Alan Modra 2026-04-17 10:56:31 +09:30
parent 8de63f13fa
commit b8b225cc68
65 changed files with 262 additions and 262 deletions

View 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)

View 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)

View 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)

View file

@ -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 *))

View 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,

View 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;

View 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;

View 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

View 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

View 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);

View 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

View 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;

View 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;

View 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;

View 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;

View 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;

View 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;

View 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)

View 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)

View 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)

View 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;

View 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;

View 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;

View 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;

View 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);

View 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);

View 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;

View 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

View 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;

View 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;

View 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;

View 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;

View 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;

View 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 =

View 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;

View 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);

View 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;

View 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,

View 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;

View 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,

View 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;

View 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;

View 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;

View 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;

View 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));

View 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;

View 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;

View 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;

View 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)

View 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;

View 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)

View 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;

View 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;

View 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

View 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)
{

View 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;
}

View 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

View 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;

View 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;

View 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;

View 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;

View 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;

View 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

View 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;

View 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);