@@ -1326,10 +1326,11 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13261326 return 1 ;
13271327 }
13281328
1329- auto fatalBothAuthAndNonAuth = [&sym]() {
1330- fatal (" both AUTH and non-AUTH TLSDESC entries for '" + sym.getName () +
1331- " ' requested, but only one type of TLSDESC entry per symbol is "
1332- " supported" );
1329+ auto errBothAuthAndNonAuth = [this , &sym, offset]() {
1330+ Err (ctx) << " both AUTH and non-AUTH TLSDESC entries for '" << sym.getName ()
1331+ << " ' requested, but only one type of TLSDESC entry per symbol is "
1332+ " supported"
1333+ << getLocation (ctx, *sec, sym, offset);
13331334 };
13341335
13351336 // Do not optimize signed TLSDESC (as described in pauthabielf64 to LE/IE).
@@ -1338,10 +1339,12 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13381339 if (oneof<RE_AARCH64_AUTH_TLSDESC_PAGE, RE_AARCH64_AUTH_TLSDESC>(
13391340 expr)) {
13401341 assert (ctx.arg .emachine == EM_AARCH64);
1341- if (!sym.hasFlag (NEEDS_TLSDESC))
1342+ if (!sym.hasFlag (NEEDS_TLSDESC)) {
13421343 sym.setFlags (NEEDS_TLSDESC | NEEDS_TLSDESC_AUTH);
1343- else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH))
1344- fatalBothAuthAndNonAuth ();
1344+ } else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH)) {
1345+ errBothAuthAndNonAuth ();
1346+ return 1 ;
1347+ }
13451348 sec->addReloc ({expr, type, offset, addend, &sym});
13461349 return 1 ;
13471350 }
@@ -1352,7 +1355,7 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13521355 // with signed TLSDESC enabled since it does not give any value, but leave a
13531356 // check against that just in case someone uses it.
13541357 if (expr != R_TLSDESC_CALL)
1355- fatalBothAuthAndNonAuth ();
1358+ errBothAuthAndNonAuth ();
13561359 return 1 ;
13571360 }
13581361
0 commit comments