This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] inconsistent DWARF2 sections generated by --gdwarf2
- From: Nick Clifton <nickc at redhat dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>, Bob Wilson <bwilson at tensilica dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 18 Nov 2004 08:43:52 +0000
- Subject: Re: [PATCH] inconsistent DWARF2 sections generated by --gdwarf2
- References: <41990311.3060504@tensilica.com> <20041118033117.GD17083@bubble.modra.org>
Hi Alan, Hi Bob,
probably harmless for GDB, but it breaks readelf, which expects a
one-to-one correspondence between .debug_info and .debug_line sections.
I would say that this is a readelf bug. The only reason that readelf
needs .debug_info when dumping .debug_line is to find the size of
addresses. readelf could guess that some other way.
I do not think so - the DWARF standard does specify that there there
should be a correspondence between the compilation units in the
.debug_info section and the compilation units in the .debug_line section:
From "Section 6.2 Line number Information":
As mentioned in Section 3.1.1, the line number information
generated for a compilation unit is represented in the
.debug_line section of an object file and is referenced by
corresponding compilation unit debugging information entry
in the .debug_info section.
As for the patch itself - I am not so sure. It looks to me like there
might be problems when -gdwarf2 is not specified on the command line.
ie GAS might still generate dwarf2 debug sections. I would need to have
a look at this and I am really swamped at the moment. :-( Bob - could
you try a few more tests of your patch please ? Say with various
different -gxxx command line switches specified ?
Cheers
Nick