aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-04-16 10:46:05 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-04-19 10:35:41 -0700
commit6ea673e2d643b7b2283aa73d35b02dfc9aa7115f (patch)
treea702e60b51ff202f51e5e20a2fee00df4a629aae /gas/as.c
parent531c82a1c724079f98a4b069584681bc66da4dae (diff)
downloadgdb-6ea673e2d643b7b2283aa73d35b02dfc9aa7115f.zip
gdb-6ea673e2d643b7b2283aa73d35b02dfc9aa7115f.tar.gz
gdb-6ea673e2d643b7b2283aa73d35b02dfc9aa7115f.tar.bz2
as: Reject unknown -gXXX option
* 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.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gas/as.c b/gas/as.c
index f320bac..0262a6f 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);