[PR ld/22263][PR ld/25056] arm: Avoid dynamic TLS relocs in PIE
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 2 Oct 2019 18:46:46 +0000 (19:46 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 10 Oct 2019 11:11:33 +0000 (12:11 +0100)
commitb094948c0943c996460cbc9ab3c14207dc520445
tree221893fb09df694f8310355cdeafe98c3e5f898c
parent772db4c6beec7c8f4f2550c1f4fe0fb35dc3c7b5
[PR ld/22263][PR ld/25056] arm: Avoid dynamic TLS relocs in PIE

Dynamic relocs are only needed in an executable for TLS symbols if
those are defined in an external module and even then TLS access
can be relaxed to use IE model instead of GD.

Several bfd_link_pic checks are turned into bfd_link_dll checks
to fix TLS handling in PIE, for the same fix some other targets
used !bfd_link_executable checks, but that includes relocatable
objects so dll seems safer (in most cases either should work, since
dynamic relocations are not applied in relocatable objects).

On arm* fixes
FAIL: Build pr22263-1

bfd/

PR ld/22263
PR ld/25056
* elf32-arm.c (elf32_arm_tls_transition): Use bfd_link_dll instead of
bfd_link_pic for TLS checks.
(elf32_arm_final_link_relocate): Likewise.
(allocate_dynrelocs_for_symbol): Likewise.
bfd/ChangeLog
bfd/elf32-arm.c