This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] inconsistent DWARF2 sections generated by --gdwarf2

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 ?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]