abi-aa icon indicating copy to clipboard operation
abi-aa copied to clipboard

[SYSVABI64] Document Thread Local Storage descriptions

Open smithp35 opened this issue 3 years ago • 1 comments

The AArch64 TLS sequences are designed so that a static linker can relax the model when it knows certain information. For example when linking an executable and the definition is known the Initial Exec model can be relaxed to the Local Exec model. These sequences should be documented so that code-generators can take advantage of linker TLS relaxation, and avoid generating code-sequences that a static linker may incorrectly relax.

The sysvabi is the most appropriate place for this documentation as TLS requires runtime support.

smithp35 avatar Jun 23 '22 15:06 smithp35

Since the section content is not shortened, perhaps this can be called optimization instead of relaxation. 3 TLS optimizations may be described:

  • TLS descriptor to Local Exec
  • TLS descriptor to Initial Exec
  • Initial Exec to Local Exec

In both GNU ld and ld.lld, TLS optimizations can be performed even if the code sequence is not consecutive (but the compiler should interleave colliding instructions).

MaskRay avatar Jun 28 '22 22:06 MaskRay