2002-08-01 H.J. Lu <hjl@gnu.org>
authorDaniel Jacobowitz <drow@false.org>
Thu, 1 Aug 2002 15:04:41 +0000 (15:04 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 1 Aug 2002 15:04:41 +0000 (15:04 +0000)
            Daniel Jacobowitz  <drow@mvista.com>

        * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced
        .debug_line section unless it has line information.

gas/ChangeLog
gas/dwarf2dbg.c

index 35862576ffbc10b8f75a8e7273c9eda029e4b490..5fe5f166522cfe8fff77b8da5203c28654bd2c80 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-01  H.J. Lu  <hjl@gnu.org>
+           Daniel Jacobowitz  <drow@mvista.com>
+
+       * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced
+       .debug_line section unless it has line information.
+
 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
 
        * config/tc-ns32k.h (md_pcrel_adjust): Supply prototype.
index b27652c9f9df3550a245b815db5000eef9f97f30..0f459a54de54536c567cd9666be0affbebae4ade 100644 (file)
@@ -1248,8 +1248,15 @@ dwarf2_finish ()
   segT line_seg;
   struct line_seg *s;
 
-  /* If no debug information was recorded, nothing to do.  */
-  if (all_segs == NULL && files_in_use <= 1)
+  /* We don't need to do anything unless:
+     - Some debug information was recorded via .file/.loc
+     - or, we are generating DWARF2 information ourself (--gdwarf2)
+     - or, there is a user-provided .debug_info section which could
+       reference the file table in the .debug_line section we generate
+       below.  */
+  if (all_segs == NULL
+      && debug_type != DEBUG_DWARF2
+      && bfd_get_section_by_name (stdoutput, ".debug_info") == NULL)
     return;
 
   /* Calculate the size of an address for the target machine.  */