aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-lm32.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-06-03 07:03:45 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-06-03 07:03:59 -0700
commitad172eaa4f5ff973890a6c37574946cecf0668b0 (patch)
treee3435bca4dd4fe1af313dae6855ca15b7ca18f47 /bfd/elf32-lm32.c
parent5dbc8b372f3a15fa4dce65d460a3cce7ed081f6c (diff)
downloadgdb-ad172eaa4f5ff973890a6c37574946cecf0668b0.zip
gdb-ad172eaa4f5ff973890a6c37574946cecf0668b0.tar.gz
gdb-ad172eaa4f5ff973890a6c37574946cecf0668b0.tar.bz2
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.
Diffstat (limited to 'bfd/elf32-lm32.c')
-rw-r--r--bfd/elf32-lm32.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index 9e95861..5d09f2d 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -2390,47 +2390,6 @@ lm32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
return TRUE;
}
-/* Copy the extra info we tack onto an elf_link_hash_entry. */
-
-static void
-lm32_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
-{
- if (ind->dyn_relocs != NULL)
- {
- if (dir->dyn_relocs != NULL)
- {
- struct elf_dyn_relocs **pp;
- struct elf_dyn_relocs *p;
-
- /* Add reloc counts against the indirect sym to the direct sym
- list. Merge any entries against the same section. */
- for (pp = &ind->dyn_relocs; (p = *pp) != NULL;)
- {
- struct elf_dyn_relocs *q;
-
- for (q = dir->dyn_relocs; q != NULL; q = q->next)
- if (q->sec == p->sec)
- {
- q->pc_count += p->pc_count;
- q->count += p->count;
- *pp = p->next;
- break;
- }
- if (q == NULL)
- pp = &p->next;
- }
- *pp = dir->dyn_relocs;
- }
-
- dir->dyn_relocs = ind->dyn_relocs;
- ind->dyn_relocs = NULL;
- }
-
- _bfd_elf_link_hash_copy_indirect (info, dir, ind);
-}
-
static bfd_boolean
lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
@@ -2518,7 +2477,6 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
#define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create
#define elf_backend_check_relocs lm32_elf_check_relocs
#define elf_backend_reloc_type_class lm32_elf_reloc_type_class
-#define elf_backend_copy_indirect_symbol lm32_elf_copy_indirect_symbol
#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections