summaryrefslogtreecommitdiff
path: root/bfd/elfxx-sparc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2010-03-02 01:46:08 +0000
committerDavid S. Miller <davem@redhat.com>2010-03-02 01:46:08 +0000
commit65fd82297c7ab0b4d5b5bfb1a40a7080a9d9e62b (patch)
tree3da544dc0df8563e2afb6f81a711bc1afdf2f154 /bfd/elfxx-sparc.c
parent5ee6181e24b1565dc9ac45e6ba1d71743b3f633f (diff)
downloadbinutils-redhat-65fd82297c7ab0b4d5b5bfb1a40a7080a9d9e62b.tar.gz
* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): When STT_GNU_IFUNC and
h->def_regular, set h->ref_regular. (allocate_dynrelocs): Only force output of STT_GNU_IFUNC plt entries and dynamic relocations if h->ref_regular.
Diffstat (limited to 'bfd/elfxx-sparc.c')
-rw-r--r--bfd/elfxx-sparc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 1947d1a1e8..2137df088f 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -1277,7 +1277,10 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (h && h->type == STT_GNU_IFUNC)
{
if (h->def_regular)
- h->plt.refcount += 1;
+ {
+ h->ref_regular = 1;
+ h->plt.refcount += 1;
+ }
}
/* Compatibility with old R_SPARC_REV32 reloc conflicting
@@ -2022,7 +2025,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
if ((htab->elf.dynamic_sections_created
&& h->plt.refcount > 0)
|| (h->type == STT_GNU_IFUNC
- && h->def_regular))
+ && h->def_regular
+ && h->ref_regular))
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -2034,7 +2038,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
}
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)
- || h->type == STT_GNU_IFUNC)
+ || (h->type == STT_GNU_IFUNC
+ && h->def_regular))
{
asection *s = htab->elf.splt;