summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2012-04-24 16:09:10 +0000
committerHans-Peter Nilsson <hp@axis.com>2012-04-24 16:09:10 +0000
commitbdcbab4c697a3bee0b39d660dbbeba3b58ec1cfd (patch)
tree15c19ecb9224ca911768c1e1b783b2626f7273f6 /bfd/elf32-arm.c
parent53a240fd819fe5abead5d3008700f57a8f790605 (diff)
downloadbinutils-redhat-bdcbab4c697a3bee0b39d660dbbeba3b58ec1cfd.tar.gz
PR ld/13990
* elf32-arm.c (elf32_arm_gc_sweep_hook): Handle a forced-local symbol, where PLT refcount is set to -1.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 629e1f21cf..9560906daa 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -12256,8 +12256,19 @@ elf32_arm_gc_sweep_hook (bfd * abfd,
if (may_need_local_target_p
&& elf32_arm_get_plt_info (abfd, eh, r_symndx, &root_plt, &arm_plt))
{
- BFD_ASSERT (root_plt->refcount > 0);
- root_plt->refcount -= 1;
+ /* If PLT refcount book-keeping is wrong and too low, we'll
+ see a zero value (going to -1) for the root PLT reference
+ count. */
+ if (root_plt->refcount >= 0)
+ {
+ BFD_ASSERT (root_plt->refcount != 0);
+ root_plt->refcount -= 1;
+ }
+ else
+ /* A value of -1 means the symbol has become local, forced
+ or seeing a hidden definition. Any other negative value
+ is an error. */
+ BFD_ASSERT (root_plt->refcount == -1);
if (!call_reloc_p)
arm_plt->noncall_refcount--;