diff options
author | Alan Modra <amodra@gmail.com> | 2020-01-22 13:02:11 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-22 17:14:08 +1030 |
commit | abc489c64a3137f3751797e8ce60d53a2c432e1d (patch) | |
tree | 3013677f8f4a43baa9dc013411b280a51d6d1dac /bfd/elf64-ppc.c | |
parent | c48acf6f26713427fb6870a8551a89ac12838e7b (diff) | |
download | gdb-abc489c64a3137f3751797e8ce60d53a2c432e1d.zip gdb-abc489c64a3137f3751797e8ce60d53a2c432e1d.tar.gz gdb-abc489c64a3137f3751797e8ce60d53a2c432e1d.tar.bz2 |
PowerPC64 TLS optimization fix
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.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 3ae294b..2ee9fe4 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; } |