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