]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR30697, ppc32 mix of local-dynamic and global-dynamic TLS
authorAlan Modra <amodra@gmail.com>
Fri, 4 Aug 2023 05:39:53 +0000 (15:09 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 4 Aug 2023 08:30:32 +0000 (18:00 +0930)
commit8c05bf16a51e413dfd3da2e018cbcd32a2a8c0f3
treeba50f4f3b070fd498bd8efa7eaa70e920847406e
parent430f01eaca715a3bf02066041ae0922ffa8164cb
PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

This fixes miscounting of dynamic relocations on GOT entries when
a) there are both local-dynamic and global-dynamic tls accesss for a
   given symbol, and
b) the symbol is global with non-default visibility, and
c) the __tls_get_addr calls aren't optimised away.

PR 30697
bfd/
* elf32-ppc.c (allocate_dynrelocs): Correct local-dynamic
reloc count.
ld/
* testsuite/ld-powerpc/tls32ldgd.d,
* testsuite/ld-powerpc/tls32ldgd.s: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit ae33771224660dac25e64c3f70943a17bfab7681)
bfd/elf32-ppc.c
ld/testsuite/ld-powerpc/powerpc.exp
ld/testsuite/ld-powerpc/tls32ldgd.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/tls32ldgd.s [new file with mode: 0644]