summaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-12-21 18:15:19 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-12-21 18:15:19 +0000
commit60ef6a53db4fb25ae17b971c72f42143778e243a (patch)
tree6b91b7246e478eb52eba1cfbb0221fc65f893a50 /bfd/elf32-i386.c
parentce29ea0119c3696f6c52b5dc5fbb1a89fb8303e7 (diff)
downloadbinutils-redhat-60ef6a53db4fb25ae17b971c72f42143778e243a.tar.gz
Properly adjust h->plt.refcount
bfd/ PR ld/14980 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Properly adjust h->plt.refcount. * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise. ld/testsuite/ PR ld/14980 * ld-ifunc/ifunc-14c.s: New file. * ld-ifunc/ifunc-14e-i386.d: Likewise. * ld-ifunc/ifunc-14e-x86-64.d: Likewise. * ld-ifunc/ifunc-14f-i386.d: Likewise. * ld-ifunc/ifunc-14f-x86-64.d: Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index fce70b95cf..f76c7a7f40 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2031,8 +2031,11 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
if (pc_count || count)
{
h->needs_plt = 1;
- h->plt.refcount += 1;
h->non_got_ref = 1;
+ if (h->plt.refcount <= 0)
+ h->plt.refcount = 1;
+ else
+ h->plt.refcount += 1;
}
}