PR28149 part 2, purge generated line info
Mixing compiler generated line info with gas generated line info is
generally just confusing. Also .loc directives with non-zero view
fields might reference a previous .loc. It becomes a little more
tricky to locate that previous .loc if there might be gas generated
line info present too. Mind you, we turn off gas generation of line
info on seeing compiler generated line info, so any reference back
won't hit gas generated line info. At least, if the view info is
sane. Unfortunately, gas needs to handle mangled source.
PR 28149
* dwarf2dbg.c (purge_generated_debug): New function.
(dwarf2_directive_filename): Call the above.
(out_debug_line): Don't segfault after purging.
* testsuite/gas/i386/dwarf2-line-4.d: Update expected output.
* testsuite/gas/i386/dwarf4-line-1.d: Likewise.
* testsuite/gas/i386/dwarf5-line-1.d: Likewise.
* testsuite/gas/i386/dwarf5-line-2.d: Likewise.