]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: Handle bad -gdwarf options, just like bad --gdwarf options.
authorMark Wielaard <mark@klomp.org>
Wed, 26 Aug 2020 19:46:04 +0000 (21:46 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 28 Aug 2020 13:26:01 +0000 (15:26 +0200)
commit4a5700b62f767ed08c97122bad182244700bb4e3
tree93dcbc99f16e535590937a39944f5d1a63945957
parent64b63c2993db8606334f6f0852b4e7bb70b5682a
gas: Handle bad -gdwarf options, just like bad --gdwarf options.

parse_args uses getopt_long_only so it can handle long options both
with double and single dash. But this means that some single dash
options like -gdwarf-1 don't generate an error (unlike --gdwarf-1).

This is especially confusing since there is also --gdwarf2, but no
--gdwarf4 (it is --gdwarf-4). When giving -gdwarf4 the option is
silently interpreted as -g (which set dwarf_version to 2). This causes
some confusion for people who don't expect this and suddenly get
DWARF2 instead of DWARF4 as they might expect.

So make it so that the -gdwarf<unknown> creates an error, just like
--gdwarf<unknown> would.
gas/ChangeLog
gas/as.c