[PATCH] D22462: [ARM][LLD] Initial support for ARM TLS

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 06:55:59 PDT 2016


peter.smith created this revision.
peter.smith added reviewers: ruiu, rafael.
peter.smith added subscribers: llvm-commits, rengolin.
Herald added a subscriber: aemerson.

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:
- ARM TLS model: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045e/IHI0045E_ABI_addenda.pdf
- Relocations: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf
- TLS variants: https://www.akkadia.org/drepper/tls.pdf

https://reviews.llvm.org/D22462

Files:
  ELF/Target.cpp
  test/ELF/arm-tls-gd32.s
  test/ELF/arm-tls-ie32.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22462.64312.patch
Type: text/x-patch
Size: 12449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160718/bd5205f7/attachment.bin>


More information about the llvm-commits mailing list