Add relocations and identification functions for the Initial Exec, Local Exec, and Global Dynamic TLS model defined in Addenda to, and Errata in, the ABI for the ARM Architecture.
ARM uses variant 1 of the thread local storage data structures as defined in ELF Handling for Thread-Local Storage. The implementation fits into to the existing TLS model so the lld change is largely just identifying relocations.
Limitations:
- The "experimental" descriptor based model that can be selected in gcc, but not clang with -mtls-dialect=gnu2 is not supported.
- The relocations R_ARM_TLS_LE12 and R_ARM_TLS_IE12GP are not supported, I know of no ARM Toolchain that generates these relocations as they are an optimization that limits the size of the TLS block too much.
- No code relaxation is supported as the standard ARM TLS model puts the TLS relocations on literal data and not code.
- Support for the local dynamic model will come in a follow up patch. The test cases depend on adding symbol(tlsldm) support to llvm-mc (https://reviews.llvm.org/D22461).
References: