This is an archive of the discontinued LLVM Phabricator instance.

[ELF][AArch64] Implement the AArch64 TLSLD_LDST_LO12 family of relocs
ClosedPublic

Authored by peter.smith on Apr 30 2018, 2:34 AM.

Details

Summary

Implement the following relocations for AArch64:
R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC
R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC
R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC
R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC
R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC

These are specified in ELF for the 64-bit Arm Architecture (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf)

These relocation directives were first used in an optimisation in https://reviews.llvm.org/D44355 . This had to be reverted as no linker (gold, ld.bfd or lld) implemented these relocations. Both gold and ld.bfd have since implemented support (https://sourceware.org/bugzilla/show_bug.cgi?id=22969 and https://sourceware.org/bugzilla/show_bug.cgi?id=22970 ) so it would be good to have LLD support as well.

Fixes pr36727

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

peter.smith created this revision.Apr 30 2018, 2:34 AM
grimar added a subscriber: grimar.May 3 2018, 6:56 AM

Updated diff to remove relocations from usesOnlyLowPageBits(). While this is true for these relocations the usesOnlyLowPageBits() function is never called for local exec TLS so by the same logic as applied to D46249 (don't add dead code) I've removed them from the patch.

ruiu accepted this revision.May 3 2018, 8:34 AM

LGTM

This revision is now accepted and ready to land.May 3 2018, 8:34 AM
This revision was automatically updated to reflect the committed changes.