binutils-gdb/ld/testsuite/ld-powerpc/tls32ldgd.d
Alan Modra ae33771224 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.
2023-08-04 17:59:01 +09:30

13 lines
448 B
Makefile

#as: -a32
#ld: -shared -melf32ppc
#readelf: -rW
Relocation section '\.rela\.dyn' at offset .* contains 3 entries:
Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
.* +00000044 R_PPC_DTPMOD32 +0
.* +0000004e R_PPC_DTPREL32 +0
.* +00000044 R_PPC_DTPMOD32 +0
Relocation section '\.rela\.plt' at offset .* contains 1 entry:
Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
.* +00000215 R_PPC_JMP_SLOT +00000000 +__tls_get_addr \+ 0