summaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2011-11-06 20:25:16 +0000
committerDave Anglin <dave.anglin@nrc.ca>2011-11-06 20:25:16 +0000
commitad4d50cb827aa965902553badfe9fdef40a7c29a (patch)
tree5787594eb2fe13e53411d3d25954b0cd9bb3a671 /bfd/elf32-hppa.c
parent8b748729923c46542500f6a4a8e050438e1f4290 (diff)
downloadbinutils-redhat-ad4d50cb827aa965902553badfe9fdef40a7c29a.tar.gz
PR ld/13387
* elf32-hppa.c (elf32_hppa_hide_symbol): Make STT_GNU_IFUNC symbol go through PLT. Reset plt field with init_plt_offset. (elf32_hppa_adjust_dynamic_symbol): Ensure that a PLT slot is allocated for symbols referenced by a plabel.
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 7f0f2cb10e..fcf51cf8d3 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1789,10 +1789,12 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
}
}
- if (! hppa_elf_hash_entry (eh)->plabel)
+ /* STT_GNU_IFUNC symbol must go through PLT. */
+ if (! hppa_elf_hash_entry (eh)->plabel
+ && eh->type != STT_GNU_IFUNC)
{
eh->needs_plt = 0;
- eh->plt = elf_hash_table (info)->init_plt_refcount;
+ eh->plt = elf_hash_table (info)->init_plt_offset;
}
}
@@ -1814,6 +1816,13 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
if (eh->type == STT_FUNC
|| eh->needs_plt)
{
+ /* If the symbol is used by a plabel, we must allocate a PLT slot.
+ The refcounts are not reliable when it has been hidden since
+ hide_symbol can be called before the plabel flag is set. */
+ if (hppa_elf_hash_entry (eh)->plabel
+ && eh->plt.refcount <= 0)
+ eh->plt.refcount = 1;
+
if (eh->plt.refcount <= 0
|| (eh->def_regular
&& eh->root.type != bfd_link_hash_defweak