PR 25917
	* dwarf2dbg.c (out_dir_and_file_list): Check for the directory
	table's existence before looking at its entries.
	* testsuite/gas/elf/pr25917.s: New test source file.
	* testsuite/gas/elf/pr25917.d: New test driver.
	* testsuite/gas/elf/elf.exp (run_elf_list_test): Run the new test.
+2020-05-04  Nick Clifton  <nickc@redhat.com>
+
+       PR 25917
+       * dwarf2dbg.c (out_dir_and_file_list): Check for the directory
+       table's existence before looking at its entries.
+       * testsuite/gas/elf/pr25917.s: New test source file.
+       * testsuite/gas/elf/pr25917.d: New test driver.
+       * testsuite/gas/elf/elf.exp (run_elf_list_test): Run the new test.
+
 2020-04-30  Alex Coplan  <alex.coplan@arm.com>
 
        * config/tc-aarch64.c (fix_insn): Implement for
 
   /* Emit directory list.  */
   if (DWARF2_LINE_VERSION >= 5)
     {
-      if (dirs[0] == NULL)
+      if (dirs == NULL || dirs[0] == NULL)
        dir = remap_debug_filename (".");
       else
        dir = remap_debug_filename (dirs[0]);
 
     run_dump_test "dwarf2-18" $dump_opts
     run_dump_test "dwarf2-19" $dump_opts
     run_dump_test "dwarf-5-file0" $dump_opts
+    run_dump_test "pr25917"
     run_dump_test "bss"
     run_dump_test "bad-bss"
     run_dump_test "bad-section-flag"
 
--- /dev/null
+#as: --gdwarf-5
+#name: DWARF5: no files or directories
+#readelf: -wl
+
+#...
+ The Directory Table is empty.
+
+ No Line Number Statements.
+#pass
 
--- /dev/null
+      .section        .debug_info,"",%progbits
+.Ldebug_info0:
+        .dc.l   0x30
+        .dc.l   0x5