diff options
author | Alan Modra <amodra@gmail.com> | 2017-07-29 12:33:35 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-07-29 13:02:27 +0930 |
commit | 8b5f1ed8777df405f3c7b87472b1506f5125aebe (patch) | |
tree | fe5af9f4c9fd47c2ee17365ddc456e86661f0f47 /ld | |
parent | ef080e7ed4a373037231e709bfa1a909f4eae0f9 (diff) | |
download | gdb-8b5f1ed8777df405f3c7b87472b1506f5125aebe.zip gdb-8b5f1ed8777df405f3c7b87472b1506f5125aebe.tar.gz gdb-8b5f1ed8777df405f3c7b87472b1506f5125aebe.tar.bz2 |
PR 21847, Don't default PowerPC64 to --plt-localentry
The big comment in ppc64_elf_tls_setup says why. I've also added some
code to the bfd linker that catches the -lpthread -lc symbol
differences and disable generation of optimized call stubs even when
--plt-localentry is activated. Gold doesn't yet have that.
PR 21847
bfd/
* elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
(ppc64_elf_merge_symbol): Set non_zero_localentry.
(is_elfv2_localentry0): Test non_zero_localentry.
(ppc64_elf_tls_setup): Default to --no-plt-localentry.
gold/
* powerpc.cc (Target_powerpc::scan_relocs): Default to
--no-plt-localentry.
ld/
* ld.texinfo (plt-localentry): Document.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/ld.texinfo | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 9345785..2a371b9 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2017-07-29 Alan Modra <amodra@gmail.com> + + * ld.texinfo (plt-localentry): Document. + 2017-07-28 Andrew Burgess <andrew.burgess@embecosm.com> * ldgram.y (ldgram_had_keep): Make static. diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 987816f..172c1dd 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -7600,6 +7600,21 @@ barrier in the call stub, or use LD_BIND_NOW=1. By default, @code{ld} looks for calls to commonly used functions that create threads, and if seen, adds the necessary barriers. Use these options to change the default behaviour. + +@cindex PowerPC64 ELFv2 PLT localentry optimization +@kindex --plt-localentry +@kindex --no-plt-localentry +@item --plt-localentry +@itemx --no-localentry +ELFv2 functions with localentry:0 are those with a single entry point, +ie. global entry == local entry, and that have no requirement on r2 +(the TOC/GOT pointer) or r12, and guarantee r2 is unchanged on return. +Such an external function can be called via the PLT without saving r2 +or restoring it on return, avoiding a common load-hit-store for small +functions. The optimization is attractive, with up to 40% reduction +in execution time for a small function, but can result in symbol +interposition failures. Use with care. @option{--no-plt-localentry} +is the default. @end table @ifclear GENERIC |