[lld] [lld] Add target support for SystemZ (s390x) (PR #75643)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 13:18:53 PST 2024


================
@@ -1374,8 +1379,8 @@ static unsigned handleTlsRelocation(RelType type, Symbol &sym,
             R_LOONGARCH_GOT_PAGE_PC, R_GOT_OFF, R_TLSIE_HINT>(expr)) {
     ctx.hasTlsIe.store(true, std::memory_order_relaxed);
     // Initial-Exec relocs can be optimized to Local-Exec if the symbol is
-    // locally defined.
-    if (execOptimize && isLocalInExecutable) {
+    // locally defined.  This is not supported on SystemZ.
+    if (execOptimize && isLocalInExecutable && config->emachine != EM_S390) {
----------------
MaskRay wrote:

I investigated this in the weekend. Seems an unfortunate ABI issue when Local-Exec is unnecessarily inefficient
https://maskray.me/blog/2024-02-11-toolchain-notes-on-z-architecture#initial-exec-tls-model

https://github.com/llvm/llvm-project/pull/75643


More information about the llvm-commits mailing list