From ad172eaa4f5ff973890a6c37574946cecf0668b0 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 3 Jun 2020 07:03:45 -0700 Subject: ELF: Copy dyn_relocs in _bfd_elf_link_hash_copy_indirect Copy dyn_relocs in _bfd_elf_link_hash_copy_indirect instead of in each target backend. PR ld/26067 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy dyn_relocs. * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise. * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise. * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol): Likewise. * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise. * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise. * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise. * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise. * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise. * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise. * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise. * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise. * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise. * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed. (elf_backend_copy_indirect_symbol): Likewise. * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed. (elf_backend_copy_indirect_symbol): Likewise. * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs. --- bfd/elf32-hppa.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'bfd/elf32-hppa.c') diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 1510043..106b5c8 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1040,42 +1040,6 @@ elf32_hppa_copy_indirect_symbol (struct bfd_link_info *info, hh_dir = hppa_elf_hash_entry (eh_dir); hh_ind = hppa_elf_hash_entry (eh_ind); - if (eh_ind->dyn_relocs != NULL - && eh_ind->root.type == bfd_link_hash_indirect) - { - if (eh_dir->dyn_relocs != NULL) - { - struct elf_dyn_relocs **hdh_pp; - struct elf_dyn_relocs *hdh_p; - - /* Add reloc counts against the indirect sym to the direct sym - list. Merge any entries against the same section. */ - for (hdh_pp = &eh_ind->dyn_relocs; (hdh_p = *hdh_pp) != NULL; ) - { - struct elf_dyn_relocs *hdh_q; - - for (hdh_q = eh_dir->dyn_relocs; - hdh_q != NULL; - hdh_q = hdh_q->next) - if (hdh_q->sec == hdh_p->sec) - { -#if RELATIVE_DYNRELOCS - hdh_q->pc_count += hdh_p->pc_count; -#endif - hdh_q->count += hdh_p->count; - *hdh_pp = hdh_p->next; - break; - } - if (hdh_q == NULL) - hdh_pp = &hdh_p->next; - } - *hdh_pp = eh_dir->dyn_relocs; - } - - eh_dir->dyn_relocs = eh_ind->dyn_relocs; - eh_ind->dyn_relocs = NULL; - } - if (eh_ind->root.type == bfd_link_hash_indirect) { hh_dir->plabel |= hh_ind->plabel; -- cgit v1.1