Skip to content

Commit afad729

Browse files
committed
Switch to printLocation from getLocation
1 parent c3c7e6c commit afad729

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lld/ELF/Relocations.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,11 @@ void RelocationScanner::processAux(RelExpr expr, RelType type, uint64_t offset,
10961096
if (!(flags & NEEDS_GOT)) {
10971097
sym.setFlags(needsGotAuth ? (NEEDS_GOT | NEEDS_GOT_AUTH) : NEEDS_GOT);
10981098
} else if (needsGotAuth != static_cast<bool>(flags & NEEDS_GOT_AUTH)) {
1099-
Err(ctx) << "both AUTH and non-AUTH GOT entries for '" << sym.getName()
1100-
<< "' requested, but only one type of GOT entry per symbol is "
1101-
"supported"
1102-
<< getLocation(ctx, *sec, sym, offset);
1099+
auto diag = Err(ctx);
1100+
diag << "both AUTH and non-AUTH GOT entries for '" << sym.getName()
1101+
<< "' requested, but only one type of GOT entry per symbol is "
1102+
"supported";
1103+
printLocation(diag, *sec, sym, offset);
11031104
}
11041105
}
11051106
} else if (needsPlt(expr)) {

lld/test/ELF/aarch64-got-relocations-pauth.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ _start:
8989
# ERR-NEXT: >>> referenced by err.o:(.text+0x8)
9090
# ERR: error: both AUTH and non-AUTH GOT entries for 'bar' requested, but only one type of GOT entry per symbol is supported
9191
# ERR-NEXT: >>> defined in a.so
92-
# ERR-NEXT: >>> referenced by err.o:(.text+0xC)
92+
# ERR-NEXT: >>> referenced by err.o:(.text+0xc)
9393

9494
.globl _start
9595
_start:

0 commit comments

Comments
 (0)