diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-12-21 18:15:22 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-12-21 18:15:22 +0000 |
commit | a5479e5ff4c29dcf93acde1424b69d4909fd3044 (patch) | |
tree | c1908afeee4aa8472b534f890d7d416765aab6f0 /bfd/elf32-i386.c | |
parent | edcac0c105556029774320bc8288beb472e999b5 (diff) | |
download | gdb-a5479e5ff4c29dcf93acde1424b69d4909fd3044.zip gdb-a5479e5ff4c29dcf93acde1424b69d4909fd3044.tar.gz gdb-a5479e5ff4c29dcf93acde1424b69d4909fd3044.tar.bz2 |
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 fce70b9..f76c7a7 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; } } |