@@ -1462,14 +1462,6 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1462
1462
return ctx.target ->getTlsGdRelaxSkip (type);
1463
1463
}
1464
1464
1465
- // LoongArch TLS GD/LD relocs reuse the RE_LOONGARCH_TLSGD_PAGE_PC, in which
1466
- // NEEDS_TLSIE shouldn't set. So we check independently.
1467
- if (ctx.arg .emachine == EM_LOONGARCH && expr == RE_LOONGARCH_GOT &&
1468
- execOptimize && isLocalInExecutable) {
1469
- sec->addReloc ({R_RELAX_TLS_IE_TO_LE, type, offset, addend, &sym});
1470
- return 1 ;
1471
- }
1472
-
1473
1465
if (oneof<R_GOT, R_GOTPLT, R_GOT_PC, RE_AARCH64_GOT_PAGE_PC,
1474
1466
RE_LOONGARCH_GOT_PAGE_PC, R_GOT_OFF, R_TLSIE_HINT>(expr)) {
1475
1467
ctx.hasTlsIe .store (true , std::memory_order_relaxed);
@@ -1489,6 +1481,15 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1489
1481
return 1 ;
1490
1482
}
1491
1483
1484
+ // LoongArch TLS GD/LD relocs reuse the RE_LOONGARCH_GOT, in which
1485
+ // NEEDS_TLSIE shouldn't set. So we check independently.
1486
+ if (ctx.arg .emachine == EM_LOONGARCH && expr == RE_LOONGARCH_GOT &&
1487
+ execOptimize && isLocalInExecutable) {
1488
+ ctx.hasTlsIe .store (true , std::memory_order_relaxed);
1489
+ sec->addReloc ({R_RELAX_TLS_IE_TO_LE, type, offset, addend, &sym});
1490
+ return 1 ;
1491
+ }
1492
+
1492
1493
return 0 ;
1493
1494
}
1494
1495
0 commit comments