From 3988aed54acce3c682a877b51b0e09cce1079e81 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 31 Oct 2017 22:13:21 +1030 Subject: PR22374, PowerPC unnecessary PLT entries We don't need a PLT entry when function pointer initialization in a read/write section is the only reference to a given function symbol. This patch prevents the unnecessary PLT entry, and ensures no dynamic relocs are emitted when UNDEFWEAK_NO_DYNAMIC_RELOC says so. bfd/ PR 22374 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt entry when just a dynamic reloc can serve. Ensure no dynamic relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref. Expand and move the non_got_ref comment. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. ld/ * testsuite/ld-powerpc/ambiguousv2.d: Remove FIXME. --- ld/ChangeLog | 4 ++++ ld/testsuite/ld-powerpc/ambiguousv2.d | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 84bebb3..bdc98d6 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,9 @@ 2017-11-01 Alan Modra + * testsuite/ld-powerpc/ambiguousv2.d: Remove FIXME. + +2017-11-01 Alan Modra + PR 22374 * testsuite/ld-elf/pr22374a.s, * testsuite/ld-elf/pr22374b.s, diff --git a/ld/testsuite/ld-powerpc/ambiguousv2.d b/ld/testsuite/ld-powerpc/ambiguousv2.d index fec3a2c..7afdfe1 100644 --- a/ld/testsuite/ld-powerpc/ambiguousv2.d +++ b/ld/testsuite/ld-powerpc/ambiguousv2.d @@ -8,16 +8,11 @@ # anything to mark it as ELFv1 or ELFv2. We should get a dynamic # reloc on the function address, not have a global entry stub, and # my_func should be undefined dynamic with value zero. -# FIXME someday: No need for a plt entry. Relocation section .* contains 1 entries: .* .* R_PPC64_ADDR64 .* my_func \+ 0 -Relocation section .* contains 1 entries: -.* -.* R_PPC64_JMP_SLOT .* my_func \+ 0 - Symbol table '\.dynsym' contains 5 entries: .* 0: .* -- cgit v1.1