binutils-gdb/ld/testsuite/ld-xtensa/tlspie.sd
Max Filippov 658ba81aef xtensa: bfd: fix TLS relocations generated for PIE
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.
2022-09-02 09:54:49 -07:00

15 lines
357 B
Plaintext

#source: tlsbin.s
#as:
#ld: -melf32xtensa
#objdump: -sj.text --stop-address=0x400238
#target: xtensa*-*-linux*
.*: +file format elf32-xtensa-.e
Contents of section .text:
*[0-9a-f]+ 0+ 0+ 0+ 0+ .*
*[0-9a-f]+ 0+ 0*080* 0+ 0*280* .*
*[0-9a-f]+ 0+ 0*480* 0+ 0*080* .*
*[0-9a-f]+ 0*290* 0*2e0* 0*480* 0*4f0* .*
*[0-9a-f]+ 0+ 0*080* 0*280* 0*480* .*