Skip to content

Commit 7e8a06c

Browse files
committed
[ELF] Make -z *-report=unknown error message conventional
1 parent cab738b commit 7e8a06c

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

lld/ELF/Driver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,8 +1632,8 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
16321632
continue;
16331633
arg->claim();
16341634
if (!isValidReportString(option.second)) {
1635-
ErrAlways(ctx) << "-z " << reportArg.first << "= parameter "
1636-
<< option.second << " is not recognized";
1635+
ErrAlways(ctx) << "unknown -z " << reportArg.first
1636+
<< "= value: " << option.second;
16371637
continue;
16381638
}
16391639
*reportArg.second = option.second;

lld/test/ELF/aarch64-bti-pac-cli-error.s

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,5 @@
1313
# CHECK-NEXT: error: -z bti-report only supported on AArch64
1414
# CHECK-NEXT: error: -z pauth-report only supported on AArch64
1515

16-
# RUN: not ld.lld -z bti-report=something -z pauth-report=something \
17-
# RUN: %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=REPORT_INVALID %s
18-
# REPORT_INVALID: error: -z bti-report= parameter something is not recognized
19-
# REPORT_INVALID: error: -z pauth-report= parameter something is not recognized
20-
# REPORT_INVALID-EMPTY:
21-
2216
.globl start
2317
start: ret

lld/test/ELF/aarch64-feature-bti.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@
258258
# FORCE-NEXT: nop
259259
# FORCE-NEXT: nop
260260

261+
# RUN: not ld.lld %t.o -z bti-report=u -o /dev/null 2>&1 | FileCheck --check-prefix=REPORT-ERR %s
262+
# REPORT-ERR: error: unknown -z bti-report= value: u{{$}}
263+
# REPORT-EMPTY:
264+
261265
.section ".note.gnu.property", "a"
262266
.long 4
263267
.long 0x10

lld/test/ELF/aarch64-feature-pauth.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
# HINT-NEXT: br x17
8484
# PACPLT-NEXT: nop
8585

86+
# RUN: not ld.lld tag1.o -z pauth-report=u 2>&1 | FileCheck --check-prefix=REPORT-ERR %s
87+
# REPORT-ERR: error: unknown -z pauth-report= value: u{{$}}
88+
# REPORT-EMPTY:
89+
8690
#--- abi-tag-short.s
8791

8892
.section ".note.gnu.property", "a"

lld/test/ELF/i386-feature-cet.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# RUN: not ld.lld -e func1 %t.o %t3.o -o /dev/null -z cet-report=something 2>&1 \
2727
# RUN: | FileCheck --check-prefix=REPORT_INVALID %s
28-
# REPORT_INVALID: error: -z cet-report= parameter something is not recognized
28+
# REPORT_INVALID: error: unknown -z cet-report= value: something
2929
# REPORT_INVALID-EMPTY:
3030

3131
# RUN: ld.lld -e func1 %t.o %t3.o -o /dev/null -z cet-report=warning 2>&1 \

lld/test/ELF/x86-64-feature-cet.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# RUN:not ld.lld -e func1 %t.o %t3.o -o /dev/null -z cet-report=something 2>&1 \
2727
# RUN: | FileCheck --check-prefix=REPORT_INVALID %s
28-
# REPORT_INVALID: error: -z cet-report= parameter something is not recognized
28+
# REPORT_INVALID: error: unknown -z cet-report= value: something
2929
# REPORT_INVALID-EMPTY:
3030

3131
# RUN: ld.lld -e func1 %t.o %t3.o -o /dev/null -z force-ibt -z cet-report=warning 2>&1 \

0 commit comments

Comments
 (0)