@@ -1352,10 +1352,11 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13521352 return 1 ;
13531353 }
13541354
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);
13591360 };
13601361
13611362 // Do not optimize signed TLSDESC (as described in pauthabielf64 to LE/IE).
@@ -1364,10 +1365,12 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13641365 if (oneof<R_AARCH64_AUTH_TLSDESC_PAGE, RelExpr::R_AARCH64_AUTH_TLSDESC>(
13651366 expr)) {
13661367 assert (ctx.arg .emachine == EM_AARCH64);
1367- if (!sym.hasFlag (NEEDS_TLSDESC))
1368+ if (!sym.hasFlag (NEEDS_TLSDESC)) {
13681369 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+ }
13711374 sec->addReloc ({expr, type, offset, addend, &sym});
13721375 return 1 ;
13731376 }
@@ -1378,7 +1381,7 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13781381 // with signed TLSDESC enabled since it does not give any value, but leave a
13791382 // check against that just in case someone uses it.
13801383 if (expr != R_TLSDESC_CALL)
1381- fatalBothAuthAndNonAuth ();
1384+ errBothAuthAndNonAuth ();
13821385 return 1 ;
13831386 }
13841387
0 commit comments