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:29:01 +0000 (17:59 +0930)
commitae33771224660dac25e64c3f70943a17bfab7681
treed48602b894890c97fb00c756b3962aaf8f480ab0
parent49459ed32b71aefd0443d82c939f05933505080e
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.
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]