@@ -1331,10 +1331,11 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1331
1331
return 1 ;
1332
1332
}
1333
1333
1334
- auto fatalBothAuthAndNonAuth = [&sym]() {
1335
- fatal (" both AUTH and non-AUTH TLSDESC entries for '" + sym.getName () +
1336
- " ' requested, but only one type of TLSDESC entry per symbol is "
1337
- " supported" );
1334
+ auto errBothAuthAndNonAuth = [this , &sym, offset]() {
1335
+ Err (ctx) << " both AUTH and non-AUTH TLSDESC entries for '" << sym.getName ()
1336
+ << " ' requested, but only one type of TLSDESC entry per symbol is "
1337
+ " supported"
1338
+ << getLocation (ctx, *sec, sym, offset);
1338
1339
};
1339
1340
1340
1341
// Do not optimize signed TLSDESC (as described in pauthabielf64 to LE/IE).
@@ -1343,10 +1344,12 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1343
1344
if (oneof<R_AARCH64_AUTH_TLSDESC_PAGE, RelExpr::R_AARCH64_AUTH_TLSDESC>(
1344
1345
expr)) {
1345
1346
assert (ctx.arg .emachine == EM_AARCH64);
1346
- if (!sym.hasFlag (NEEDS_TLSDESC))
1347
+ if (!sym.hasFlag (NEEDS_TLSDESC)) {
1347
1348
sym.setFlags (NEEDS_TLSDESC | NEEDS_TLSDESC_AUTH);
1348
- else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH))
1349
- fatalBothAuthAndNonAuth ();
1349
+ } else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH)) {
1350
+ errBothAuthAndNonAuth ();
1351
+ return 1 ;
1352
+ }
1350
1353
sec->addReloc ({expr, type, offset, addend, &sym});
1351
1354
return 1 ;
1352
1355
}
@@ -1357,7 +1360,7 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1357
1360
// with signed TLSDESC enabled since it does not give any value, but leave a
1358
1361
// check against that just in case someone uses it.
1359
1362
if (expr != R_TLSDESC_CALL)
1360
- fatalBothAuthAndNonAuth ();
1363
+ errBothAuthAndNonAuth ();
1361
1364
return 1 ;
1362
1365
}
1363
1366
0 commit comments