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.