[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
Wed Feb 12 10:15:41 PST 2020


sidneym updated this revision to Diff 244180.
sidneym added a comment.

Update functionNames.

The original ABI, which is over 10 years old,  may have used SPARC and 32-bit x86 as a reference:
0x00 leal  x at tlsgd(,%ebx,1), %eax
0x07 call  x at tlsgdplt

or:
0x00 sethi %hi(@dtlndx(x)), %o0
0x04 add   %o0, %lo(@dtlndx(x)), %o0
0x08 add   %l7, %o0, %o0
0x0c call  x at TLSPLT

SPARC adds the __tls_get_addr symbol in the assembler when a VK_Sparc_TLS_GD_CALL is found.  The same could be done for Hexagon (VK_Hexagon_GD_PLT), avoiding the need to create the symbol, but that would mean objects not built with the change would fail to link if using lld and that relocation was used.  The symbol update would still be needed.

With the above in mind, I should probably check for the existence of __tls_get_addr prior to calling hexagonNeedsTLSSymbol.


Repository:
  rG LLVM Github Monorepo

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

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.244180.patch
Type: text/x-patch
Size: 5934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/b9155dfb/attachment.bin>


More information about the llvm-commits mailing list