This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Power7 thread-safe plt call stubs
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 5 Dec 2012 15:29:06 +1030
- Subject: Power7 thread-safe plt call stubs
Fixes an off by one error in thread-safe power7 plt call stubs,
affecting large executables and shared libraries that call more than
32767 functions. The retry path runs off into the weeds for stubs
32768 and above. Committed.
* elf64-ppc.c (build_plt_stub): Fix off by one error in branch
to glink.
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.396
diff -u -p -r1.396 elf64-ppc.c
--- bfd/elf64-ppc.c 6 Nov 2012 05:18:03 -0000 1.396
+++ bfd/elf64-ppc.c 5 Dec 2012 02:41:27 -0000
@@ -9653,8 +9653,8 @@ build_plt_stub (struct ppc_link_hash_tab
bfd_vma glinkoff = GLINK_CALL_STUB_SIZE + pltindex * 8;
bfd_vma to, from;
- if (pltindex > 32767)
- glinkoff += (pltindex - 32767) * 4;
+ if (pltindex > 32768)
+ glinkoff += (pltindex - 32768) * 4;
to = (glinkoff
+ htab->glink->output_offset
+ htab->glink->output_section->vma);
--
Alan Modra
Australia Development Lab, IBM