[PATCH] D74443: [lld][Hexagon] convert call x at GDPLT to call __tls_get_addr

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 14:46:42 PST 2020


sidneym added a comment.

In D74443#1891747 <https://reviews.llvm.org/D74443#1891747>, @MaskRay wrote:

> > The method Hexagon uses is similar to 32-bit SPARC.
>
> Can you explain how 32-bit SPARC do this? What about 64-bit SPARC?


One method SPARC would have used can be found in older versions of binutils.  
+  if (!sparc_tls_symbol)
+    sparc_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_addr");
See: https://gcc.gnu.org/ml/gcc-patches/2003-09/msg00456.html

The Introduction section of the Hexagon ABI doc refers to some of the resources used, http://docs.oracle.com/cd/E19253-01/817-1984/  -- "The call instruction uses the special syntax, x at TLSPLT. This call references the TLS variable and generates the R_SPARC_TLS_GD_CALL relocation. This relocation instructs the link-editor to bind the call to the __tls_get_addr() function, and associates the call instruction with the GD code sequence."  Hexagon does the same.

The 64Bit ABI didn't do this, it just makes the call.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74443





More information about the llvm-commits mailing list