https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101575
--- Comment #12 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Eric Botcazou from comment #1)
> Not going to be fixed, just stick to the default setting (DWARF 5).
one minor remark, while working on a patch, I became aware,
that probably the same will happen when using -gdwarf-5
with old binutils, since we have this code in dwarf2out.c:
#if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) &&
defined(HAVE_AS_WORKING_DWARF_N_FLAG)
if (output_asm_line_debug_info () && dwarf_version >= 5)
{
/* When gas outputs DWARF5 .debug_line[_str] then we have to
tell it the comp_dir and main file name for the zero entry
line table. */
const char *comp_dir, *filename0;
comp_dir = comp_dir_string ();
if (comp_dir == NULL)
comp_dir = "";
filename0 = get_AT_string (comp_unit_die (), DW_AT_name);
if (filename0 == NULL)
filename0 = "";
fprintf (asm_out_file, "\t.file 0 ");
output_quoted_string (asm_out_file, remap_debug_filename (comp_dir));
fputc (' ', asm_out_file);
output_quoted_string (asm_out_file, remap_debug_filename (filename0));
fputc ('\n', asm_out_file);
}
#endif