@@ -1348,10 +1348,11 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13481348 return 1 ;
13491349 }
13501350
1351- auto fatalBothAuthAndNonAuth = [&sym]() {
1352- fatal (" both AUTH and non-AUTH TLSDESC entries for '" + sym.getName () +
1353- " ' requested, but only one type of TLSDESC entry per symbol is "
1354- " supported" );
1351+ auto errBothAuthAndNonAuth = [this , &sym, offset]() {
1352+ Err (ctx) << " both AUTH and non-AUTH TLSDESC entries for '" << sym.getName ()
1353+ << " ' requested, but only one type of TLSDESC entry per symbol is "
1354+ " supported"
1355+ << getLocation (ctx, *sec, sym, offset);
13551356 };
13561357
13571358 // Do not optimize signed TLSDESC (as described in pauthabielf64 to LE/IE).
@@ -1360,10 +1361,12 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13601361 if (oneof<RE_AARCH64_AUTH_TLSDESC_PAGE, RE_AARCH64_AUTH_TLSDESC>(
13611362 expr)) {
13621363 assert (ctx.arg .emachine == EM_AARCH64);
1363- if (!sym.hasFlag (NEEDS_TLSDESC))
1364+ if (!sym.hasFlag (NEEDS_TLSDESC)) {
13641365 sym.setFlags (NEEDS_TLSDESC | NEEDS_TLSDESC_AUTH);
1365- else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH))
1366- fatalBothAuthAndNonAuth ();
1366+ } else if (!sym.hasFlag (NEEDS_TLSDESC_AUTH)) {
1367+ errBothAuthAndNonAuth ();
1368+ return 1 ;
1369+ }
13671370 sec->addReloc ({expr, type, offset, addend, &sym});
13681371 return 1 ;
13691372 }
@@ -1374,7 +1377,7 @@ unsigned RelocationScanner::handleTlsRelocation(RelExpr expr, RelType type,
13741377 // with signed TLSDESC enabled since it does not give any value, but leave a
13751378 // check against that just in case someone uses it.
13761379 if (expr != R_TLSDESC_CALL)
1377- fatalBothAuthAndNonAuth ();
1380+ errBothAuthAndNonAuth ();
13781381 return 1 ;
13791382 }
13801383
0 commit comments