This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_25-branch] Tweak ppc32 tls_get_addr optimisation
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 18 Mar 2015 13:23:51 -0000
- Subject: [binutils-gdb/binutils-2_25-branch] Tweak ppc32 tls_get_addr optimisation
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7235408fe7c91d7605144f106bff5e58a0097786
commit 7235408fe7c91d7605144f106bff5e58a0097786
Author: Alan Modra <amodra@gmail.com>
Date: Fri Feb 27 11:43:21 2015 +1030
Tweak ppc32 tls_get_addr optimisation
This patch is cosmetic. It prevents references to __tls_get_addr_opt
(an alias for __tls_get_addr) when the optimisation isn't possible.
* elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
not PLT_NEW.
Diff:
---
bfd/ChangeLog | 4 ++++
bfd/elf32-ppc.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9ef3b7b..b8558b0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,6 +1,10 @@
2015-03-18 Alan Modra <amodra@gmail.com>
Apply from master
+ 2015-02-28 Alan Modra <amodra@gmail.com>
+ * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
+ not PLT_NEW.
+
2015-02-26 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
thread-safe stubs for iplt.
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 3325406..e7aa4e4 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -5087,6 +5087,9 @@ ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info)
htab = ppc_elf_hash_table (info);
htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr",
FALSE, FALSE, TRUE);
+ if (htab->plt_type != PLT_NEW)
+ htab->params->no_tls_get_addr_opt = TRUE;
+
if (!htab->params->no_tls_get_addr_opt)
{
struct elf_link_hash_entry *opt, *tga;