[PATCH] D70398: [lld] Support copy relocations for TLS symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 15:13:56 PST 2019


MaskRay added a comment.

> Note that, for both GCC and LLVM, the default model used for TLS variables in position-depedent code is LE even if extern, relying on TLS copy relocations.

So RISC-V is in its own camp here. I played with other architectures. All use Initial Exec (a GOT for TPREL) for extern TLS variables.

i386: R_386_TLS_IE
ARM: R_ARM_TLS_IE32
MIPS: R_MIPS_TLS_GOTTPREL
AArch64: R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC
PowerPC32: R_PPC_GOT_TPREL16
PowerPC64: R_PPC64_GOT_TPREL16_LO_DS

Can you refer to me notes/links about the decision choice? This looks to me a bad design.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70398





More information about the llvm-commits mailing list