aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-10-25 16:19:08 +0000
committerAlan Modra <amodra@gmail.com>2005-10-25 16:19:08 +0000
commitfcfa13d2b2b18f83382c2a0cb82c9c7d21be10cb (patch)
treeec64c0d7e60df6c1bd711a63b76fbe71bff79d69 /bfd/elf32-sh.c
parent50afb01e1a80ee200521e4e3990a80df7ed3526c (diff)
downloadgdb-fcfa13d2b2b18f83382c2a0cb82c9c7d21be10cb.zip
gdb-fcfa13d2b2b18f83382c2a0cb82c9c7d21be10cb.tar.gz
gdb-fcfa13d2b2b18f83382c2a0cb82c9c7d21be10cb.tar.bz2
PR ld/1540
* elf-bfd.h (elf_backend_copy_indirect_symbol): Replace pointer to elf_backend_data with pointer to bfd_link_info. (_bfd_elf_link_hash_copy_indirect): Likewise. * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Handle direct and indirect symbols both having dynamic link info. * elf32-arm.c (elf32_arm_copy_indirect_symbol): Likewise. * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Likewise. * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise. * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise. * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise. * elflink.c: Adjust all calls to bed->elf_backend_copy_indirect_symbol. * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Update prototype. * elfxx-sparc.h (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r--bfd/elf32-sh.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index abbee05..4d1e280 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -6063,14 +6063,11 @@ sh_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
+sh_elf_copy_indirect_symbol (struct bfd_link_info *info,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
struct elf_sh_link_hash_entry *edir, *eind;
-#ifdef INCLUDE_SHMEDIA
- bfd_signed_vma tmp;
-#endif
edir = (struct elf_sh_link_hash_entry *) dir;
eind = (struct elf_sh_link_hash_entry *) ind;
@@ -6082,9 +6079,7 @@ sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_sh_dyn_relocs **pp;
struct elf_sh_dyn_relocs *p;
- BFD_ASSERT (ind->root.type != bfd_link_hash_indirect);
-
- /* Add reloc counts against the weak sym to the strong sym
+ /* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
{
@@ -6110,14 +6105,8 @@ sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
edir->gotplt_refcount = eind->gotplt_refcount;
eind->gotplt_refcount = 0;
#ifdef INCLUDE_SHMEDIA
- tmp = edir->datalabel_got.refcount;
- if (tmp < 1)
- {
- edir->datalabel_got.refcount = eind->datalabel_got.refcount;
- eind->datalabel_got.refcount = tmp;
- }
- else
- BFD_ASSERT (eind->datalabel_got.refcount < 1);
+ edir->datalabel_got.refcount += eind->datalabel_got.refcount;
+ eind->datalabel_got.refcount = 0;
#endif
if (ind->root.type == bfd_link_hash_indirect
@@ -6139,7 +6128,7 @@ sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
dir->needs_plt |= ind->needs_plt;
}
else
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ _bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
static int