@@ -1352,10 +1352,11 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1352
1352
return 1 ;
1353
1353
}
1354
1354
1355
- auto fatalBothAuthAndNonAuth = [&sym]() {
1356
- fatal (" both AUTH and non-AUTH TLSDESC entries for '" + sym.getName () +
1357
- " ' requested, but only one type of TLSDESC entry per symbol is "
1358
- " supported" );
1355
+ auto errBothAuthAndNonAuth = [this , &sym, offset]() {
1356
+ Err (ctx) << " both AUTH and non-AUTH TLSDESC entries for '" << sym.getName ()
1357
+ << " ' requested, but only one type of TLSDESC entry per symbol is "
1358
+ " supported"
1359
+ << getLocation (ctx, *sec, sym, offset);
1359
1360
};
1360
1361
1361
1362
// Do not optimize signed TLSDESC (as described in pauthabielf64 to LE/IE).
@@ -1364,10 +1365,12 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1364
1365
if (oneof<R_AARCH64_AUTH_TLSDESC_PAGE, RelExpr::R_AARCH64_AUTH_TLSDESC>(
1365
1366
expr)) {
1366
1367
assert (ctx.arg .emachine == EM_AARCH64);
1367
- if (!sym.hasFlag (NEEDS_TLSDESC))
1368
+ if (!sym.hasFlag (NEEDS_TLSDESC)) {
1368
1369
sym.setFlags (NEEDS_TLSDESC | NEEDS_TLSDESC_AUTH);
1369
- else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH))
1370
- fatalBothAuthAndNonAuth ();
1370
+ } else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH)) {
1371
+ errBothAuthAndNonAuth ();
1372
+ return 1 ;
1373
+ }
1371
1374
sec->addReloc ({expr, type, offset, addend, &sym});
1372
1375
return 1 ;
1373
1376
}
@@ -1378,7 +1381,7 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
1378
1381
// with signed TLSDESC enabled since it does not give any value, but leave a
1379
1382
// check against that just in case someone uses it.
1380
1383
if (expr != R_TLSDESC_CALL)
1381
- fatalBothAuthAndNonAuth ();
1384
+ errBothAuthAndNonAuth ();
1382
1385
return 1 ;
1383
1386
}
1384
1387
0 commit comments