d5e63f6
--- binutils.orig/gas/dwarf2dbg.c	2021-01-18 15:02:20.322260068 +0000
d5e63f6
+++ binutils-2.35.1/gas/dwarf2dbg.c	2021-01-18 15:04:20.078481127 +0000
d5e63f6
@@ -537,7 +537,11 @@ dwarf2_gen_line_info (addressT ofs, stru
d5e63f6
   if (loc->line == 0)
d5e63f6
     return;
d5e63f6
   if (loc->filenum == 0 && DWARF2_LINE_VERSION < 5)
d5e63f6
-    return;
d5e63f6
+    {
d5e63f6
+      dwarf_level = 5;
d5e63f6
+      if (DWARF2_LINE_VERSION < 5)
d5e63f6
+       return;
d5e63f6
+    }
d5e63f6
 
d5e63f6
   /* Don't emit sequences of line symbols for the same line when the
d5e63f6
      symbols apply to assembler code.  It is necessary to emit
d5e63f6
@@ -1030,9 +1034,13 @@ dwarf2_directive_filename (void)
d5e63f6
 
d5e63f6
   if ((offsetT) num < 1 && DWARF2_LINE_VERSION < 5)
d5e63f6
     {
d5e63f6
-      as_bad (_("file number less than one"));
d5e63f6
-      ignore_rest_of_line ();
d5e63f6
-      return NULL;
d5e63f6
+      dwarf_level = 5;
d5e63f6
+      if (DWARF2_LINE_VERSION < 5)
d5e63f6
+       {
d5e63f6
+         as_bad (_("file number less than one"));
d5e63f6
+         ignore_rest_of_line ();
d5e63f6
+         return NULL;
d5e63f6
+       }
d5e63f6
     }
d5e63f6
 
d5e63f6
   /* FIXME: Should we allow ".file <N>\n" as an expression meaning
d5e63f6
@@ -1129,8 +1137,12 @@ dwarf2_directive_loc (int dummy ATTRIBUT
d5e63f6
     {
d5e63f6
       if (filenum != 0 || DWARF2_LINE_VERSION < 5)
d5e63f6
 	{
d5e63f6
-	  as_bad (_("file number less than one"));
d5e63f6
-	  return;
d5e63f6
+	  dwarf_level = 5;
d5e63f6
+	  if (DWARF2_LINE_VERSION < 5)
d5e63f6
+	    {
d5e63f6
+	      as_bad (_("file number less than one"));
d5e63f6
+	      return;
d5e63f6
+	    }
d5e63f6
 	}
d5e63f6
     }
d5e63f6