Skip to content

Commit 6313f5c

Browse files
committed
Switch to printLocation from getLocation
1 parent bb4d8bc commit 6313f5c

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
@@ -1109,10 +1109,11 @@ void RelocationScanner::processAux(RelExpr expr, RelType type, uint64_t offset,
11091109
if (!(flags & NEEDS_GOT)) {
11101110
sym.setFlags(needsGotAuth ? (NEEDS_GOT | NEEDS_GOT_AUTH) : NEEDS_GOT);
11111111
} else if (needsGotAuth != static_cast<bool>(flags & NEEDS_GOT_AUTH)) {
1112-
Err(ctx) << "both AUTH and non-AUTH GOT entries for '" << sym.getName()
1113-
<< "' requested, but only one type of GOT entry per symbol is "
1114-
"supported"
1115-
<< getLocation(ctx, *sec, sym, offset);
1112+
auto diag = Err(ctx);
1113+
diag << "both AUTH and non-AUTH GOT entries for '" << sym.getName()
1114+
<< "' requested, but only one type of GOT entry per symbol is "
1115+
"supported";
1116+
printLocation(diag, *sec, sym, offset);
11161117
}
11171118
}
11181119
} 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)