diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-12-21 18:15:19 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-12-21 18:15:19 +0000 |
commit | 60ef6a53db4fb25ae17b971c72f42143778e243a (patch) | |
tree | 6b91b7246e478eb52eba1cfbb0221fc65f893a50 /bfd/elf32-i386.c | |
parent | ce29ea0119c3696f6c52b5dc5fbb1a89fb8303e7 (diff) | |
download | binutils-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.c | 5 |
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; } } |