-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)
- Loading branch information
Showing
4 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#PR 30697 | ||
.section ".tbss","awT",@nobits | ||
.global _start,x | ||
.hidden x | ||
.align 2 | ||
x: .space 4 | ||
|
||
.text | ||
_start: | ||
addi 3,30,x@got@tlsgd | ||
bl __tls_get_addr(x@tlsgd)@plt | ||
|
||
addi 3,30,x@got@tlsld | ||
bl __tls_get_addr(x@tlsld)@plt | ||
addis 3,3,x@dtprel@ha | ||
addi 3,3,x@dtprel@l |