Duplicate .debug_lines (Was: [PATCH 5/5] Add --gdwarf-5 to ASM_SPEC)
Sat Aug 29 16:32:53 GMT 2020
On Sat, Aug 29, 2020 at 08:43:30AM -0700, H.J. Lu wrote:
> On Sat, Aug 29, 2020 at 8:23 AM Mark Wielaard <email@example.com> wrote:
> > My proposal, and what my strawman patch implements, is that gas will
> > generate a .debug_line section when -g is given and the debug types is
> > DWARF (just as it does now). Unless there is a non-empty .debug_line
> > section already created by the input assembly and the input assembly
> > does not contain any .loc directive then gas will not try to generate
> > a .debug_line section itself but leaves the non-empty .debug_line as
> > is (currently gas will generate an error in this case). But if the
> > input assembly does contain both .loc directives and creates a
> > non-empty .debug line section gas will still generate an error (as it
> > does now, whether or not the input assembly contains any .loc
> > directives).
> > Does this sound sane?
> What if there is a .file directive, but without .loc directive, like
> $ gcc -c x.c -Wa,-g
That situation does not change, since in that case no .debug_*
sections are generated in the assembly file, so gas will generate
everything it currently generates.
More information about the Gcc-patches