[llvm-branch-commits] [lld] [lld][LoongArch] Relax TLS LE/GD/LD (PR #123600)

WÁNG Xuěruì via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Feb 16 17:44:03 PST 2025


================
@@ -1015,8 +1063,20 @@ void LoongArch::finalizeRelax(int passes) const {
             r.expr = r.sym->hasFlag(NEEDS_PLT) ? R_PLT_PC : R_PC;
             break;
           case R_LARCH_B26:
+          case R_LARCH_TLS_LE_LO12_R:
+            skip = 4;
+            write32le(p, aux.writes[writesIdx++]);
+            break;
+          case R_LARCH_TLS_GD_PCREL20_S2:
+            // Note: R_LARCH_TLS_LD_PCREL20_S2 must also use R_TLSGD_PC instead
+            // of R_TLSLD_PC because the processing of relocation
+            // R_LARCH_TLS_LD_PC_HI20 is the same as R_LARCH_TLS_GD_PC_HI20. If
----------------
xen0n wrote:

According to [this mold commit](https://github.com/rui314/mold/commit/5dfa1cf07c03bd57cb3d493b652ef22441bcd71c) this is mostly due to human error (compiler bug that's unfortunately too late to fix without revising psABI), so you may want to mention it somehow to reduce reader confusion. "If not, ... will error" is clearly not the root cause and likely will not satisfy the curiosity of many.

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


More information about the llvm-branch-commits mailing list