When generating TLS dynamic relocations the existing xtensa BFD code treats linking to a PIE exactly as linking to a shared object, resulting in generation of wrong relocations for TLS entries. Fix that and add tests. bfd/ * elf32-xtensa.c (elf_xtensa_check_relocs): Use bfd_link_dll instead of bfd_link_pic. Add elf_xtensa_dynamic_symbol_p test when generating GOT entries. (elf_xtensa_relocate_section): Use bfd_link_dll instead of bfd_link_pic. ld/ * testsuite/ld-xtensa/tlspie.dd: New file. * testsuite/ld-xtensa/tlspie.rd: New file. * testsuite/ld-xtensa/tlspie.sd: New file. * testsuite/ld-xtensa/tlspie.td: New file. * testsuite/ld-xtensa/xtensa-linux.exp (TLS PIE transitions): New test.
15 lines
410 B
TableGen
15 lines
410 B
TableGen
#source: tlsbin.s
|
|
#ld: -melf32xtensa
|
|
#objdump: -sj.tdata
|
|
#target: xtensa*-*-linux*
|
|
|
|
.*: +file format elf32-xtensa-.e
|
|
|
|
Contents of section .tdata:
|
|
*[0-9a-f]+ 0*110* 0*120* 0*130* 0*140* .*
|
|
*[0-9a-f]+ 0*150* 0*160* 0*170* 0*180* .*
|
|
*[0-9a-f]+ 0*410* 0*420* 0*430* 0*440* .*
|
|
*[0-9a-f]+ 0*450* 0*460* 0*470* 0*480* .*
|
|
*[0-9a-f]+ 0*9d0* 0*9e0* 0*9f0* 0*a00* .*
|
|
*[0-9a-f]+ 0*a10* 0*a20* 0*a30* 0*a40* .*
|