This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: GAS not emitting debug_line section when it should
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Re: GAS not emitting debug_line section when it should
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Mon, 18 Jun 2001 19:35:24 +0930
- Cc: binutils at sources dot redhat dot com, rth at redhat dot com
- References: <87ofrpukfg.fsf@cgsoftware.com>
On Sat, Jun 16, 2001 at 12:18:27AM -0400, Daniel Berlin wrote:
> If we only have .file directives, we never output .debug_line section.
Does this do what you want?
Index: dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.39
diff -u -p -r1.39 dwarf2dbg.c
--- dwarf2dbg.c 2001/05/22 10:23:48 1.39
+++ dwarf2dbg.c 2001/06/18 09:41:05
@@ -1212,7 +1212,7 @@ dwarf2_finish ()
struct line_seg *s;
/* If no debug information was recorded, nothing to do. */
- if (all_segs == NULL)
+ if (all_segs == NULL && files_in_use <= 1)
return;
/* Calculate the size of an address for the target machine. */
@@ -1239,7 +1239,7 @@ dwarf2_finish ()
/* If this is assembler generated line info, we need .debug_info
and .debug_abbrev sections as well. */
- if (debug_type == DEBUG_DWARF2)
+ if (all_segs != NULL && debug_type == DEBUG_DWARF2)
{
segT abbrev_seg;
segT info_seg;