as: Automatically enable DWARF5 support
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 18 Jan 2021 14:25:05 +0000 (06:25 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 18 Jan 2021 14:25:17 +0000 (06:25 -0800)
commit705989f19adf20dd70c50237ec61cd708f2b0939
tree155d39d16f36b66359d9a8f92d7e51a5e43c8ce0
parent6a9ad81c449922e8c0d3228c18422f68136eef17
as: Automatically enable DWARF5 support

Currently

$ as -o x.o x.s

fails when x.s contains DWARF5 ".file 0" or ".loc 0" directives.  Update
assembler to automatically enable DWARF5 support so that

$ gcc -S -g -c x.c
$ gcc -c x.s

works.

PR gas/27195
* dwarf2dbg.c (dwarf2_gen_line_info): Set dwarf_level to 5 if
needed.
(dwarf2_directive_filename): Likewise.
(dwarf2_directive_loc): Likewise.
* testsuite/gas/elf/dwarf-5-file0.d: Pass --gdwarf-3.
* testsuite/gas/lns/lns-diag-1.l: Remove the
"Error: file number less than one" errors.
gas/ChangeLog
gas/dwarf2dbg.c
gas/testsuite/gas/elf/dwarf-5-file0.d
gas/testsuite/gas/lns/lns-diag-1.l