aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-nds32.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-07-30 03:41:30 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-07-30 03:41:44 -0700
commitf1dfbfdbc6c07a8ee4ea185a2f15615600857531 (patch)
treebf9191cd8e6d39ac0a0aaf6d2ff945660feec1d0 /bfd/elf32-nds32.c
parent6cc64caabac2f835149d0931d5ab689ccca1ca08 (diff)
downloadgdb-f1dfbfdbc6c07a8ee4ea185a2f15615600857531.zip
gdb-f1dfbfdbc6c07a8ee4ea185a2f15615600857531.tar.gz
gdb-f1dfbfdbc6c07a8ee4ea185a2f15615600857531.tar.bz2
elf: Add sym_cache to elf_link_hash_table
Since many ELF backends have sym_cache to their link hash tables, add sym_cache to elf_link_hash_table. Also use sdynbss and srelbss in elf_link_hash_table. * elf-bfd.h (sym_cache): Moved before elf_link_hash_table. (elf_link_hash_table): Add sym_cache. * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache. (elf32_arm_check_relocs): Updated. (elf32_arm_size_dynamic_sections): Likewise. * elf32-bfin.c (bfin_link_hash_table): Removed. (bfin_link_hash_newfunc): Updated. (bfin_hash_table): Removed. * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache. (csky_elf_check_relocs): Updated. * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache. (elf32_hppa_check_relocs): Updated. * elf32-i386.c (elf_i386_tls_transition): Updated. (elf_i386_convert_load_reloc): Likewise. (elf_i386_check_relocs): Likewise. * elf32-m32r.c (elf_m32r_link_hash_table): Removed. (m32r_elf_hash_table): Updated. (m32r_elf_link_hash_table_create): Likewise. (m32r_elf_create_dynamic_sections): Likewise. (m32r_elf_adjust_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (m32r_elf_size_dynamic_sections): Likewise. (m32r_elf_relocate_section): Likewise. (m32r_elf_finish_dynamic_symbol): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove sym_cache. * elf32-m68k.c (elf_m68k_link_hash_table): Likewise. (elf_m68k_check_relocs): Updated. * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache. (elf_metag_check_relocs): Updated. * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec. (microblaze_elf_check_relocs): Updated. * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise. (nds32_elf_create_dynamic_sections): Likewise. (nds32_elf_adjust_dynamic_symbol): Likewise. (nds32_elf_check_relocs): Likewise. * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss, srelbss and aym_cache. * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache. (nios2_elf32_check_relocs): Updated. * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec. (or1k_elf_check_relocs): Updated. * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache. (ppc_elf_check_relocs): Updated. * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache. (elf_s390_check_relocs): Updated. (elf_s390_finish_dynamic_sections): Likewise. * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss and aym_cache. (sh_elf_create_dynamic_sections): Updated. (sh_elf_adjust_dynamic_symbol): Likewise. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_check_relocs): Likewise. * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache. (elf32_tic6x_check_relocs): Updated. * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed. (tilepro_elf_hash_table): Updated. (tilepro_elf_link_hash_table_create): Likewise. (tilepro_elf_check_relocs): Likewise. (tilepro_elf_adjust_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (tilepro_elf_size_dynamic_sections): Likewise. (tilepro_elf_relocate_section): Likewise. (tilepro_elf_finish_dynamic_symbol): Likewise. (tilepro_finish_dyn): Likewise. (tilepro_elf_finish_dynamic_sections): Likewise. * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache. (ppc64_elf_before_check_relocs): Updated. (ppc64_elf_check_relocs): Likewise. * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache. (elf_s390_check_relocs): Updated. (elf_s390_relocate_section): Likewise. (elf_s390_finish_dynamic_sections): Likewise. * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise. (elf_x86_64_check_relocs): Likewise. * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove sym_cache. (elfNN_aarch64_check_relocs): Updated. * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache. (riscv_elf_check_relocs): Updated. * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache. (mips_elf_resolve_got_page_ref): Updated. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove sym_cache. * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise. (tilegx_elf_check_relocs): Updated. * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
Diffstat (limited to 'bfd/elf32-nds32.c')
-rw-r--r--bfd/elf32-nds32.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index 186ab36..1f9f9ba 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *abfd)
return NULL;
}
- ret->sdynbss = NULL;
- ret->srelbss = NULL;
ret->sym_ld_script = NULL;
return &ret->root.root;
@@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
initialize them at run time. The linker script puts the .dynbss
section into the .bss section of the final image. */
s = bfd_make_section (abfd, ".dynbss");
- htab->sdynbss = s;
+ htab->root.sdynbss = s;
if (s == NULL
|| !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED))
return FALSE;
@@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
{
s = bfd_make_section (abfd, (bed->default_use_rela_p
? ".rela.bss" : ".rel.bss"));
- htab->srelbss = s;
+ htab->root.srelbss = s;
if (s == NULL
|| !bfd_set_section_flags (s, flags | SEC_READONLY)
|| !bfd_set_section_alignment (s, ptralign))
@@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
same memory location for the variable. */
htab = nds32_elf_hash_table (info);
- s = htab->sdynbss;
+ s = htab->root.sdynbss;
BFD_ASSERT (s != NULL);
/* We must generate a R_NDS32_COPY reloc to tell the dynamic linker
@@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
{
asection *srel;
- srel = htab->srelbss;
+ srel = htab->root.srelbss;
BFD_ASSERT (srel != NULL);
srel->size += sizeof (Elf32_External_Rela);
h->needs_copy = 1;
@@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
void *vpp;
Elf_Internal_Sym *isym;
- isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
+ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
+ abfd, r_symndx);
if (isym == NULL)
return FALSE;