[PATCH] as: Add a .dwarf_level directive to set the DWARF level
Fangrui Song
i@maskray.me
Sun Jan 17 06:11:53 GMT 2021
On 2021-01-16, H.J. Lu via Binutils wrote:
>Currently
>
>$ as -o x.o x.s
>
>fails when x.s contains DWARF5 info. Add a .dwarf_level directive to
>set the DWARF level and GCC can emit ".dwarf_level 5" when generating
>DWARF5 info so that
>
>$ gcc -S -g -c x.c
>$ gcc -c x.s
>
>works.
The problem is file number 0 in .file and .loc directives. An alternative
design is to detect number 0 and upgrade to DWARF v5 line tables automatically.
If we decide to add a new directive, .dwarf_version is better than .dwarf_level .
The DWARF specifications don't use the term "level".
More information about the Binutils
mailing list