[PATCH] D109293: [JITLink][WIP] Add initial native TLS support to ELFNix platform

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 5 09:05:27 PDT 2021


StephenFan created this revision.
StephenFan added a reviewer: lhames.
Herald added subscribers: pengfei, hiraditya, mgorny.
StephenFan requested review of this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

This patch use the same way as the https://reviews.llvm.org/rGfe1fa43f16beac1506a2e73a9f7b3c81179744eb to handle the thread local variable.

It allocates 2 * pointerSize space in GOT to represent the thread key and data address. Instead of using the _tls_get_addr function, I customed a function __orc_rt_elfnix_tls_get_addr to get the address of thread local varible. Currently, this is a wip patch, only one TLS relocation R_X86_64_TLSGD is supported and I need to add the corresponding test cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109293

Files:
  compiler-rt/lib/orc/CMakeLists.txt
  compiler-rt/lib/orc/elfnix_platform.cpp
  compiler-rt/lib/orc/elfnix_tls.x86-64.S
  llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
  llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
  llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
  llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
  llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
  llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
  llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
  llvm/lib/ExecutionEngine/JITLink/PerGraphGOTAndPLTStubsBuilder.h
  llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109293.370811.patch
Type: text/x-patch
Size: 25439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210905/9ee93d79/attachment.bin>


More information about the llvm-commits mailing list