@@ -1323,7 +1323,9 @@ static unsigned handleAArch64PAuthTlsRelocation(InputSectionBase *sec,
1323
1323
unsigned RelocationScanner::handleTlsRelocation (RelExpr expr, RelType type,
1324
1324
uint64_t offset, Symbol &sym,
1325
1325
int64_t addend) {
1326
- if (ctx.arg .emachine == EM_AARCH64)
1326
+ bool isAArch64 = ctx.arg .emachine == EM_AARCH64;
1327
+
1328
+ if (isAArch64)
1327
1329
if (unsigned processed = handleAArch64PAuthTlsRelocation (
1328
1330
sec, expr, type, offset, sym, addend))
1329
1331
return processed;
@@ -1362,10 +1364,10 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1362
1364
// R_RISCV_TLSDESC_{LOAD_LO12,ADD_LO12_I,CALL} reference a label. Do not
1363
1365
// set NEEDS_TLSDESC on the label.
1364
1366
if (expr != R_TLSDESC_CALL) {
1365
- if (!isRISCV || type == R_RISCV_TLSDESC_HI20 )
1366
- sym.setFlags (
1367
- NEEDS_TLSDESC |
1368
- (ctx. arg . emachine == EM_AARCH64 ? NEEDS_TLSDESC_NONAUTH : 0 ) );
1367
+ if (isAArch64 )
1368
+ sym.setFlags (NEEDS_TLSDESC | NEEDS_TLSDESC_NONAUTH);
1369
+ else if (!isRISCV || type == R_RISCV_TLSDESC_HI20)
1370
+ sym. setFlags (NEEDS_TLSDESC );
1369
1371
sec->addReloc ({expr, type, offset, addend, &sym});
1370
1372
}
1371
1373
return 1 ;
0 commit comments