[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 11 14:13:37 PST 2020


sidneym created this revision.
sidneym added reviewers: MaskRay, shankare, bcain, kparzysz.
Herald added subscribers: fedor.sergeev, arichardson, emaste, jyknight.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

In the General Dynamic model, TLS variables are referenced by :

  r0 = add(r24, #x at GDGOT)    // R_HEX_GD_GOT...
  call x at GDPLT                         // R_HEX_GD_PLT_B22_PCREL

The linker must rebind the call x at GDPLT to call __tls_get_addr in order to dereference the tls variable.
The method Hexagon uses is similar to 32-bit SPARC.

The thunking code was very useful since it modeled what I needed to do.  I would have liked to have been able to add the symbol in HexagonTLSSymbolUpdate if it was found to be needed.  When I tried that the dynamic symbol table entry was not correct.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74443

Files:
  lld/ELF/Arch/Hexagon.cpp
  lld/ELF/Relocations.cpp
  lld/ELF/Relocations.h
  lld/ELF/Writer.cpp
  lld/test/ELF/hexagon-tls-gd-xform.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74443.243975.patch
Type: text/x-patch
Size: 5943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200211/a49b3d22/attachment.bin>


More information about the llvm-commits mailing list