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