summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-10-25 16:19:08 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-10-25 16:19:08 +0000
commit5c818fc4573b0f1b6df519e47fce4d5b5bbe1370 (patch)
treec4f0d1e70792b83189e8688a3c9365d36b10ac32 /bfd/elf32-arm.c
parent65b99c68cb6eba7b71e76c9d1983d7d97eb5fd48 (diff)
downloadbinutils-redhat-5c818fc4573b0f1b6df519e47fce4d5b5bbe1370.tar.gz
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-arm.c')
-rw-r--r--bfd/elf32-arm.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index c4bfd3107d..6f220e9631 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -1793,7 +1793,7 @@ elf32_arm_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
+elf32_arm_copy_indirect_symbol (struct bfd_link_info *info,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
@@ -1809,10 +1809,7 @@ elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf32_arm_relocs_copied **pp;
struct elf32_arm_relocs_copied *p;
- if (ind->root.type == bfd_link_hash_indirect)
- abort ();
-
- /* 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->relocs_copied; (p = *pp) != NULL; )
{
@@ -1836,16 +1833,9 @@ elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
eind->relocs_copied = NULL;
}
- /* If the direct symbol already has an associated PLT entry, the
- indirect symbol should not. If it doesn't, swap refcount information
- from the indirect symbol. */
- if (edir->plt_thumb_refcount == 0)
- {
- edir->plt_thumb_refcount = eind->plt_thumb_refcount;
- eind->plt_thumb_refcount = 0;
- }
- else
- BFD_ASSERT (eind->plt_thumb_refcount == 0);
+ /* Copy over PLT info. */
+ edir->plt_thumb_refcount += eind->plt_thumb_refcount;
+ eind->plt_thumb_refcount = 0;
if (ind->root.type == bfd_link_hash_indirect
&& dir->got.refcount <= 0)
@@ -1854,7 +1844,7 @@ elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed,
eind->tls_type = GOT_UNKNOWN;
}
- _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
+ _bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
/* Create an ARM elf linker hash table. */