* [PATCH] as: Reject unknown -gXXX option
@ 2022-04-16 17:48 H.J. Lu
2022-04-19 10:16 ` Nick Clifton
2022-04-20 14:15 ` Alan Modra
0 siblings, 2 replies; 3+ messages in thread
From: H.J. Lu @ 2022-04-16 17:48 UTC (permalink / raw)
To: binutils
* as.c (parse_args): Reject unknown -gXXX option.
* testsuite/gas/all/empty.s: New file.
* testsuite/gas/all/pr29067.d: Likewise.
* testsuite/gas/all/pr29067.err: Likewise.
* testsuite/gas/all/gas.exp: Run pr29067.
---
gas/as.c | 2 ++
gas/testsuite/gas/all/empty.s | 1 +
gas/testsuite/gas/all/gas.exp | 1 +
gas/testsuite/gas/all/pr29067.d | 2 ++
gas/testsuite/gas/all/pr29067.err | 2 ++
5 files changed, 8 insertions(+)
create mode 100644 gas/testsuite/gas/all/empty.s
create mode 100644 gas/testsuite/gas/all/pr29067.d
create mode 100644 gas/testsuite/gas/all/pr29067.err
diff --git a/gas/as.c b/gas/as.c
index f320bac89b5..0262a6fec98 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -836,6 +836,8 @@ This program has absolutely no warranty.\n"));
versions/sections/options. */
if (startswith (old_argv[optind - 1], "-gdwarf"))
as_fatal (_("unknown DWARF option %s\n"), old_argv[optind - 1]);
+ else if (old_argv[optind - 1][1] == 'g' && optarg != NULL)
+ as_fatal (_("unknown option `%s'"), old_argv[optind - 1]);
if (md_debug_format_selector)
debug_type = md_debug_format_selector (& use_gnu_debug_info_extensions);
diff --git a/gas/testsuite/gas/all/empty.s b/gas/testsuite/gas/all/empty.s
new file mode 100644
index 00000000000..6ac6c76e752
--- /dev/null
+++ b/gas/testsuite/gas/all/empty.s
@@ -0,0 +1 @@
+/* Empty input. */
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index ae7957b2ee0..db927121f63 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -506,3 +506,4 @@ run_dump_test "pr27384"
run_dump_test "pr27381"
run_dump_test "multibyte1"
run_dump_test "multibyte2"
+run_dump_test "pr29067"
diff --git a/gas/testsuite/gas/all/pr29067.d b/gas/testsuite/gas/all/pr29067.d
new file mode 100644
index 00000000000..17a8eefe454
--- /dev/null
+++ b/gas/testsuite/gas/all/pr29067.d
@@ -0,0 +1,2 @@
+#as: -gsomething-not-already-a-long-option
+#error_output: pr29067.err
diff --git a/gas/testsuite/gas/all/pr29067.err b/gas/testsuite/gas/all/pr29067.err
new file mode 100644
index 00000000000..e5a1b27d644
--- /dev/null
+++ b/gas/testsuite/gas/all/pr29067.err
@@ -0,0 +1,2 @@
+Assembler messages:
+Fatal error: unknown option `-gsomething-not-already-a-long-option'
--
2.35.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] as: Reject unknown -gXXX option
2022-04-16 17:48 [PATCH] as: Reject unknown -gXXX option H.J. Lu
@ 2022-04-19 10:16 ` Nick Clifton
2022-04-20 14:15 ` Alan Modra
1 sibling, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2022-04-19 10:16 UTC (permalink / raw)
To: H.J. Lu, binutils
Hi H.J.
> * as.c (parse_args): Reject unknown -gXXX option.
> * testsuite/gas/all/empty.s: New file.
> * testsuite/gas/all/pr29067.d: Likewise.
> * testsuite/gas/all/pr29067.err: Likewise.
> * testsuite/gas/all/gas.exp: Run pr29067.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] as: Reject unknown -gXXX option
2022-04-16 17:48 [PATCH] as: Reject unknown -gXXX option H.J. Lu
2022-04-19 10:16 ` Nick Clifton
@ 2022-04-20 14:15 ` Alan Modra
1 sibling, 0 replies; 3+ messages in thread
From: Alan Modra @ 2022-04-20 14:15 UTC (permalink / raw)
To: H.J. Lu; +Cc: binutils
On Sat, Apr 16, 2022 at 10:48:41AM -0700, H.J. Lu wrote:
> * as.c (parse_args): Reject unknown -gXXX option.
> * testsuite/gas/all/empty.s: New file.
> * testsuite/gas/all/pr29067.d: Likewise.
> * testsuite/gas/all/pr29067.err: Likewise.
> * testsuite/gas/all/gas.exp: Run pr29067.
The new test wasn't tested. I'm reverting it. There isn't much point
to this test anyway.
alpha-dec-vms +FAIL: gas/all/pr29067
alpha-linux +FAIL: gas/all/pr29067
alpha-linuxecoff +FAIL: gas/all/pr29067
alpha-netbsd +FAIL: gas/all/pr29067
alpha-unknown-freebsd4.7 +FAIL: gas/all/pr29067
hppa64-hp-hpux11.23 +ERROR: sed failure
hppa64-hp-hpux11.23 +ERROR: tcl error sourcing /home/alan/src/binutils-gdb/gas/testsuite/gas/all/gas.exp.
hppa64-hp-hpux11.23 +ERROR: can't read "comp_output": no such variable
hppa-hp-hpux10 +ERROR: sed failure
hppa-hp-hpux10 +ERROR: tcl error sourcing /home/alan/src/binutils-gdb/gas/testsuite/gas/all/gas.exp.
hppa-hp-hpux10 +ERROR: can't read "comp_output": no such variable
mips64el-openbsd +FAIL: gas/all/pr29067
mips64-linux +FAIL: gas/all/pr29067
mips64-openbsd +FAIL: gas/all/pr29067
mipsel-linux-gnu +FAIL: gas/all/pr29067
mipsisa32el-linux +FAIL: gas/all/pr29067
mipsisa32r2el-elf +FAIL: gas/all/pr29067
mips-linux +FAIL: gas/all/pr29067
mips-sgi-irix6 +FAIL: gas/all/pr29067
mipstx39-elf +FAIL: gas/all/pr29067
mips-vxworks +FAIL: gas/all/pr29067
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-20 14:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-16 17:48 [PATCH] as: Reject unknown -gXXX option H.J. Lu
2022-04-19 10:16 ` Nick Clifton
2022-04-20 14:15 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).