* PowerPC64 TLS optimization fix
@ 2020-01-22 7:15 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-01-22 7:15 UTC (permalink / raw)
To: binutils
When linking with --no-tls-optimize the linker doesn't generate a call
or long branch stub to __tls_get_addr in some circumstances, giving:
relocation truncated to fit: R_PPC64_REL24 against symbol `__tls_get_addr'
* elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
which __tls_get_addr calls will be eliminated.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 3ae294b500..2ee9fe404c 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -13083,7 +13083,8 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
if (!get_tls_mask (&tls_mask, NULL, NULL, &local_syms,
irela - 1, input_bfd))
goto error_ret_free_internal;
- if ((*tls_mask & TLS_TLS) != 0)
+ if ((*tls_mask & TLS_TLS) != 0
+ && (*tls_mask & (TLS_GD | TLS_LD)) == 0)
continue;
}
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-22 7:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22 7:15 PowerPC64 TLS optimization fix Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).