diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2018-01-25 12:16:06 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2018-01-25 12:16:06 +0100 |
commit | bb363086e7743506d78bc6b1e56face0fb1fc93f (patch) | |
tree | 727ee3a49b87274a9c621005a7f24350edff9dba /ld/testsuite/ld-sparc/tlssunbin64.rd | |
parent | 3e53a58e1f557f9b799506b62ac1cbf456b34647 (diff) | |
download | gdb-bb363086e7743506d78bc6b1e56face0fb1fc93f.zip gdb-bb363086e7743506d78bc6b1e56face0fb1fc93f.tar.gz gdb-bb363086e7743506d78bc6b1e56face0fb1fc93f.tar.bz2 |
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC).
There are actually 2 different bugs:
1. TLS transition is broken in PIE mode.
2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol
is versioned (as is the case on Linux and Solaris at least).
The 1st bug is fixed by reverting the problematic change for now
(note that the associated test doesn't pass on SPARC because of another
issue so there is no formal regression in the testsuite). The 2nd bug
is fixed by changing the call to _bfd_generic_link_add_one_symbol
on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs.
bfd/
* elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
Do a mere lookup of the __tls_get_addr symbol instead of adding it.
Revert
2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22263
* elfxx-sparc.c (sparc_elf_tls_transition): Replace
bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
bfd_link_executable for TLS check.
(_bfd_sparc_elf_check_relocs): Likewise.
(allocate_dynrelocs): Likewise.
(_bfd_sparc_elf_relocate_section): Likewise.
ld/
* testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library):
Link with a version script.
(32-bit: TLS -fpie): New test.
(64-bit: Helper shared library): Link with a version script.
(64-bit: TLS -fpie): New test.
(64-bit: GOTDATA relocations): Pass -Av9 to the assembler.
* testsuite/ld-sparc/tlslib.ver: New file.
* testsuite/ld-sparc/tlspie32.dd: Likewise.
* testsuite/ld-sparc/tlspie32.s: Likewise.
* testsuite/ld-sparc/tlspie64.dd: Likewise.
* testsuite/ld-sparc/tlspie64.s: Likewise.
* testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol.
* testsuite/ld-sparc/tlssunbin32.rd: Likewise.
* testsuite/ld-sparc/tlssunbin32.sd: Likewise.
* testsuite/ld-sparc/tlssunbin64.dd: Likewise.
* testsuite/ld-sparc/tlssunbin64.rd: Likewise.
* testsuite/ld-sparc/tlssunbin64.sd: Likewise.
Diffstat (limited to 'ld/testsuite/ld-sparc/tlssunbin64.rd')
-rw-r--r-- | ld/testsuite/ld-sparc/tlssunbin64.rd | 114 |
1 files changed, 59 insertions, 55 deletions
diff --git a/ld/testsuite/ld-sparc/tlssunbin64.rd b/ld/testsuite/ld-sparc/tlssunbin64.rd index 420d595..2956cfe 100644 --- a/ld/testsuite/ld-sparc/tlssunbin64.rd +++ b/ld/testsuite/ld-sparc/tlssunbin64.rd @@ -13,12 +13,14 @@ Section Headers: +\[[ 0-9]+\] .hash +.* +\[[ 0-9]+\] .dynsym +.* +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .gnu.version +.* + +\[[ 0-9]+\] .gnu.version_r +.* +\[[ 0-9]+\] .rela.dyn +.* +\[[ 0-9]+\] .text +PROGBITS +0+101000 0+1000 0+11a4 00 +AX +0 +0 4096 +\[[ 0-9]+\] .tdata +PROGBITS +0+2021a4 0+21a4 0+0060 00 WAT +0 +0 +4 +\[[ 0-9]+\] .tbss +NOBITS +0+202204 0+2204 0+40 00 WAT +0 +0 +4 - +\[[ 0-9]+\] .dynamic +DYNAMIC +0+202208 0+2208 0+100 10 +WA +4 +0 +8 - +\[[ 0-9]+\] .got +PROGBITS +0+202308 0+2308 0+28 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+202208 0+2208 0+130 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+202338 0+2338 0+28 08 +WA +0 +0 +8 +\[[ 0-9]+\] .symtab +.* +\[[ 0-9]+\] .strtab +.* +\[[ 0-9]+\] .shstrtab +.* @@ -51,12 +53,12 @@ Symbol table '\.dynsym' contains [0-9]+ entries: .* NOTYPE +LOCAL +DEFAULT +UND * .* TLS +GLOBAL +DEFAULT +UND sG5 .* TLS +GLOBAL +DEFAULT +UND sG2 -.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr -.* NOTYPE +GLOBAL +DEFAULT +10 __bss_start +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr@SUNWprivate_1.1 \(2\) +.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start .* TLS +GLOBAL +DEFAULT +UND sG6 .* TLS +GLOBAL +DEFAULT +UND sG1 -.* NOTYPE +GLOBAL +DEFAULT +10 _edata -.* NOTYPE +GLOBAL +DEFAULT +10 _end +.* NOTYPE +GLOBAL +DEFAULT +12 _edata +.* NOTYPE +GLOBAL +DEFAULT +12 _end Symbol table '\.symtab' contains [0-9]+ entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name @@ -71,59 +73,61 @@ Symbol table '\.symtab' contains [0-9]+ entries: .* SECTION +LOCAL +DEFAULT +8 * .* SECTION +LOCAL +DEFAULT +9 * .* SECTION +LOCAL +DEFAULT +10 * +.* SECTION +LOCAL +DEFAULT +11 * +.* SECTION +LOCAL +DEFAULT +12 * .* FILE +LOCAL +DEFAULT +ABS .* -.* TLS +LOCAL +DEFAULT +7 sl1 -.* TLS +LOCAL +DEFAULT +7 sl2 -.* TLS +LOCAL +DEFAULT +7 sl3 -.* TLS +LOCAL +DEFAULT +7 sl4 -.* TLS +LOCAL +DEFAULT +7 sl5 -.* TLS +LOCAL +DEFAULT +7 sl6 -.* TLS +LOCAL +DEFAULT +7 sl7 -.* TLS +LOCAL +DEFAULT +7 sl8 +.* TLS +LOCAL +DEFAULT +9 sl1 +.* TLS +LOCAL +DEFAULT +9 sl2 +.* TLS +LOCAL +DEFAULT +9 sl3 +.* TLS +LOCAL +DEFAULT +9 sl4 +.* TLS +LOCAL +DEFAULT +9 sl5 +.* TLS +LOCAL +DEFAULT +9 sl6 +.* TLS +LOCAL +DEFAULT +9 sl7 +.* TLS +LOCAL +DEFAULT +9 sl8 .* FILE +LOCAL +DEFAULT +ABS .* -.* TLS +LOCAL +DEFAULT +8 bl1 -.* TLS +LOCAL +DEFAULT +8 bl2 -.* TLS +LOCAL +DEFAULT +8 bl3 -.* TLS +LOCAL +DEFAULT +8 bl4 -.* TLS +LOCAL +DEFAULT +8 bl5 -.* TLS +LOCAL +DEFAULT +8 bl6 -.* TLS +LOCAL +DEFAULT +8 bl7 -.* TLS +LOCAL +DEFAULT +8 bl8 +.* TLS +LOCAL +DEFAULT +10 bl1 +.* TLS +LOCAL +DEFAULT +10 bl2 +.* TLS +LOCAL +DEFAULT +10 bl3 +.* TLS +LOCAL +DEFAULT +10 bl4 +.* TLS +LOCAL +DEFAULT +10 bl5 +.* TLS +LOCAL +DEFAULT +10 bl6 +.* TLS +LOCAL +DEFAULT +10 bl7 +.* TLS +LOCAL +DEFAULT +10 bl8 .* FILE +LOCAL +DEFAULT +ABS .* -.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC -.* OBJECT +LOCAL +DEFAULT +10 _PROCEDURE_LINKAGE_TABLE_ -.* OBJECT +LOCAL +DEFAULT +10 _GLOBAL_OFFSET_TABLE_ -.* TLS +GLOBAL +DEFAULT +7 sg8 -.* TLS +GLOBAL +DEFAULT +8 bg8 -.* TLS +GLOBAL +DEFAULT +8 bg6 +.* OBJECT +LOCAL +DEFAULT +11 _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +12 _PROCEDURE_LINKAGE_TABLE_ +.* OBJECT +LOCAL +DEFAULT +12 _GLOBAL_OFFSET_TABLE_ +.* TLS +GLOBAL +DEFAULT +9 sg8 +.* TLS +GLOBAL +DEFAULT +10 bg8 +.* TLS +GLOBAL +DEFAULT +10 bg6 .* TLS +GLOBAL +DEFAULT +UND sG5 -.* TLS +GLOBAL +DEFAULT +8 bg3 -.* TLS +GLOBAL +DEFAULT +7 sg3 -.* TLS +GLOBAL +HIDDEN +7 sh3 +.* TLS +GLOBAL +DEFAULT +10 bg3 +.* TLS +GLOBAL +DEFAULT +9 sg3 +.* TLS +GLOBAL +HIDDEN +9 sh3 .* TLS +GLOBAL +DEFAULT +UND sG2 -.* TLS +GLOBAL +DEFAULT +7 sg4 -.* TLS +GLOBAL +DEFAULT +7 sg5 -.* TLS +GLOBAL +DEFAULT +8 bg5 -.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr -.* TLS +GLOBAL +HIDDEN +7 sh7 -.* TLS +GLOBAL +HIDDEN +7 sh8 -.* TLS +GLOBAL +DEFAULT +7 sg1 -.* FUNC +GLOBAL +DEFAULT +6 _start -.* TLS +GLOBAL +HIDDEN +7 sh4 -.* TLS +GLOBAL +DEFAULT +8 bg7 -.* TLS +GLOBAL +HIDDEN +7 sh5 -.* NOTYPE +GLOBAL +DEFAULT +10 __bss_start +.* TLS +GLOBAL +DEFAULT +9 sg4 +.* TLS +GLOBAL +DEFAULT +9 sg5 +.* TLS +GLOBAL +DEFAULT +10 bg5 +.* TLS +GLOBAL +HIDDEN +9 sh7 +.* TLS +GLOBAL +HIDDEN +9 sh8 +.* TLS +GLOBAL +DEFAULT +9 sg1 +.* FUNC +GLOBAL +DEFAULT +8 _start +.* TLS +GLOBAL +HIDDEN +9 sh4 +.* TLS +GLOBAL +DEFAULT +10 bg7 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr@@SUNWprivate_1.1 +.* TLS +GLOBAL +HIDDEN +9 sh5 +.* NOTYPE +GLOBAL +DEFAULT +12 __bss_start .* TLS +GLOBAL +DEFAULT +UND sG6 -.* FUNC +GLOBAL +DEFAULT +6 fn2 -.* TLS +GLOBAL +DEFAULT +7 sg2 +.* FUNC +GLOBAL +DEFAULT +8 fn2 +.* TLS +GLOBAL +DEFAULT +9 sg2 .* TLS +GLOBAL +DEFAULT +UND sG1 -.* TLS +GLOBAL +HIDDEN +7 sh1 -.* TLS +GLOBAL +DEFAULT +7 sg6 -.* TLS +GLOBAL +DEFAULT +7 sg7 -.* NOTYPE +GLOBAL +DEFAULT +10 _edata -.* NOTYPE +GLOBAL +DEFAULT +10 _end -.* TLS +GLOBAL +HIDDEN +7 sh2 -.* TLS +GLOBAL +HIDDEN +7 sh6 -.* TLS +GLOBAL +DEFAULT +8 bg2 -.* TLS +GLOBAL +DEFAULT +8 bg1 -.* TLS +GLOBAL +DEFAULT +8 bg4 +.* TLS +GLOBAL +HIDDEN +9 sh1 +.* TLS +GLOBAL +DEFAULT +9 sg6 +.* TLS +GLOBAL +DEFAULT +9 sg7 +.* NOTYPE +GLOBAL +DEFAULT +12 _edata +.* NOTYPE +GLOBAL +DEFAULT +12 _end +.* TLS +GLOBAL +HIDDEN +9 sh2 +.* TLS +GLOBAL +HIDDEN +9 sh6 +.* TLS +GLOBAL +DEFAULT +10 bg2 +.* TLS +GLOBAL +DEFAULT +10 bg1 +.* TLS +GLOBAL +DEFAULT +10 bg4 |