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
On Thu, Nov 18, 2004 at 08:43:52AM +0000, Nick Clifton wrote:
> 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.
But that's the other way around, .debug_info references .debug_line. In
this case we have .debug_line with no .debug_info, which should be OK.
--
Alan Modra
IBM OzLabs - Linux Technology Centre