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

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 21:16:40 PDT 2021


StephenFan added inline comments.


================
Comment at: compiler-rt/lib/orc/elfnix_tls.x86-64.S:20
+	.globl ___orc_rt_elfnix_tls_get_addr
+___orc_rt_elfnix_tls_get_addr:
+        pushq           %rbp
----------------
MoritzS wrote:
> Do we need to save all registers here? I saw you took this from the implementation in MachO and I'm not familiar with the ABI there. But for ELFNix I don't think that is necessary. For TLSGD/TLSLD relocations the compiler already emits a regular function call to `__tls_get_addr` which means that it already takes care of saving the caller saved registers. Also, since you implemented `__orc_rt_elfnix_tls_get_addr_impl` as a regular function in C++, its generated assembly will also correctly store all callee saved registers.
I agree with you, although I am not a ELF x86-64 expert.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109293



More information about the llvm-commits mailing list