From 7b5b197e80f04c9b95fe7fafbd9907fc61a1e43d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 12 Sep 2011 18:17:36 +0000 Subject: Use .got.plt for IFUNC symbols if there are no GOT relocations. bfd/ 2011-09-12 H.J. Lu PR ld/13178 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Use .got.plt if there are no GOT relocations. ld/testsuite/ 2011-09-12 H.J. Lu PR ld/13178 * ld-ifunc/ifunc-13-i386.d: Updated. * ld-ifunc/ifunc-13-x86-64.d: Likewise. * ld-ifunc/ifunc-3a-x86.d: Likewise. * ld-x86-64/pr13082-5a.d: Likewise. * ld-ifunc/ifunc-15-i386.d: New. * ld-ifunc/ifunc-15-i386.s: Likewise. * ld-ifunc/ifunc-15-x86-64.d: Likewise. * ld-ifunc/ifunc-15-x86-64.s: Likewise. --- bfd/ChangeLog | 6 ++++++ bfd/elf-ifunc.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5339ad0..9d63ff6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2011-09-12 H.J. Lu + + PR ld/13178 + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Use .got.plt + if there are no GOT relocations. + 2011-09-09 Kai Tietz * peicode.h (pe_ILF_build_a_bfd): Don't remove leading underscore diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c index 81429b8..3ba96c7 100644 --- a/bfd/elf-ifunc.c +++ b/bfd/elf-ifunc.c @@ -299,9 +299,10 @@ keep: 5. Otherwise use .got so that it can be shared among different objects at run-time. We only need to relocate .got entry in shared object. */ - if ((info->shared - && (h->dynindx == -1 - || h->forced_local)) + if (h->got.refcount <= 0 + || (info->shared + && (h->dynindx == -1 + || h->forced_local)) || (!info->shared && !h->pointer_equality_needed) || (info->executable && info->shared) -- cgit v1.1