[PATCH] D89789: [LLD][ELF] Add --force-tls-variant2 option

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 11:24:05 PDT 2020


MaskRay requested changes to this revision.
MaskRay added a comment.
This revision now requires changes to proceed.

I have checked with a few folks. ARM has never used TLS variant 2 (nor does GNU ld support such an option).
Every target doing TLS variant 1/2 has its unique special case. The generic --force-tls-variant2 does not seem to make lots of sense.
For example, on AArch64, this requires a reinterpretation of R_AARCH64_TLSLE_ADD_TPREL_LO12 and other relocation types' ranges.

Such non-standard TLS deviation happened once for a more widely project, Android bionic. Despite its popularity, it hindered regular AArch64 and thus I have tried very hard to help them migrate from the LLD hack. I have made extensive TLS improvement in LLD (with help from Ryan Prichard on Android side), added .reloc directives to the integrated assembler, and eventually removed the hack in D62055 <https://reviews.llvm.org/D62055>, and let Android resolve the issue on their ld.so. For yours, I think you can fix them on the ld.so's side.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89789/new/

https://reviews.llvm.org/D89789



More information about the llvm-commits mailing list