Skip to content

Commit 0e00de1

Browse files
jrtc27resistor
authored andcommitted
[ELF][CHERI] Tweak error message to be clearer and have better style
1 parent 1885920 commit 0e00de1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lld/ELF/SyntheticSections.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,10 @@ class RelocationBaseSection : public SyntheticSection {
554554
expr = R_ADDEND;
555555
if (sym.isFunc() && addend != 0) {
556556
auto diag = Warn(ctx);
557-
diag << "got capability relocation with non-zero addend (0x"
558-
<< llvm::utohexstr(addend)
559-
<< ") against function "
557+
diag << "capability relocation with non-zero addend (0x"
558+
<< llvm::utohexstr(addend) << ") against preemptible function "
560559
<< toStr(ctx, sym)
561-
<< ". This may not be supported by the runtime linker.";
560+
<< "; this may not be supported by the runtime linker.";
562561
printLocationMessage(diag, sec, sym, offsetInSec);
563562
}
564563
}

lld/test/ELF/cheri/riscv/preemptible-func-addend.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ global:
1919
.data
2020
foo:
2121
.chericap local + 1
22-
# CHECK: warning: got capability relocation with non-zero addend (0x1) against function global. This may not be supported by the runtime linker.
22+
# CHECK: warning: capability relocation with non-zero addend (0x1) against preemptible function global; this may not be supported by the runtime linker
2323
.chericap global + 1
24-
# CHECK: warning: got capability relocation with non-zero addend (0x1) against function undef. This may not be supported by the runtime linker.
24+
# CHECK: warning: capability relocation with non-zero addend (0x1) against preemptible function undef; this may not be supported by the runtime linker
2525
.chericap undef + 1

0 commit comments

Comments
 (0)