@@ -1430,14 +1430,6 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1430
1430
return ctx.target ->getTlsGdRelaxSkip (type);
1431
1431
}
1432
1432
1433
- // LoongArch TLS GD/LD relocs reuse the RE_LOONGARCH_TLSGD_PAGE_PC, in which
1434
- // NEEDS_TLSIE shouldn't set. So we check independently.
1435
- if (ctx.arg .emachine == EM_LOONGARCH && expr == RE_LOONGARCH_GOT &&
1436
- execOptimize && isLocalInExecutable) {
1437
- sec->addReloc ({R_RELAX_TLS_IE_TO_LE, type, offset, addend, &sym});
1438
- return 1 ;
1439
- }
1440
-
1441
1433
if (oneof<R_GOT, R_GOTPLT, R_GOT_PC, RE_AARCH64_GOT_PAGE_PC,
1442
1434
RE_LOONGARCH_GOT_PAGE_PC, R_GOT_OFF, R_TLSIE_HINT>(expr)) {
1443
1435
ctx.hasTlsIe .store (true , std::memory_order_relaxed);
@@ -1457,6 +1449,15 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1457
1449
return 1 ;
1458
1450
}
1459
1451
1452
+ // LoongArch TLS GD/LD relocs reuse the RE_LOONGARCH_GOT, in which
1453
+ // NEEDS_TLSIE shouldn't set. So we check independently.
1454
+ if (ctx.arg .emachine == EM_LOONGARCH && expr == RE_LOONGARCH_GOT &&
1455
+ execOptimize && isLocalInExecutable) {
1456
+ ctx.hasTlsIe .store (true , std::memory_order_relaxed);
1457
+ sec->addReloc ({R_RELAX_TLS_IE_TO_LE, type, offset, addend, &sym});
1458
+ return 1 ;
1459
+ }
1460
+
1460
1461
return 0 ;
1461
1462
}
1462
1463
0 commit comments