Skip to content

[Relocator] Resolve IE TLS GOT entries statically in PIE#1410

Open
quic-areg wants to merge 1 commit into
qualcomm:release/22.xfrom
quic-areg:tls-ie-pie-static-got
Open

[Relocator] Resolve IE TLS GOT entries statically in PIE#1410
quic-areg wants to merge 1 commit into
qualcomm:release/22.xfrom
quic-areg:tls-ie-pie-static-got

Conversation

@quic-areg

Copy link
Copy Markdown
Contributor

For non-preemptible symbols accessed through R_GOTTPOFF / R_TLS_IE, the IE-mode GOT entry was being initialized with a dynamic TPREL/TPOFF relocation in any non-static link, including -pie. PIE executables are not preempted, so the static TLS offset is known at link time and a dynamic relocation is both unnecessary and rejected by the loader.

Also set DF_STATIC_TLS on AArch64, ARM, and RISCV (Hexagon and X86 already do).

Fixes: #1110

For non-preemptible symbols accessed through R_*_GOTTPOFF / R_*_TLS_IE,
the IE-mode GOT entry was being initialized with a dynamic
TPREL/TPOFF relocation in any non-static link, including -pie. PIE
executables are not preempted, so the static TLS offset is known at
link time and a dynamic relocation is both unnecessary and rejected
by the loader.

Also set `DF_STATIC_TLS` on AArch64, ARM, and RISCV
(Hexagon and X86 already do).

Fixes: qualcomm#1110

Signed-off-by: quic-areg <aregmi@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants