[adtools] Re: Possible binutils problem

  • From: Thomas Frieden <thomasf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: adtools@xxxxxxxxxxxxx
  • Date: Wed, 11 Oct 2006 15:21:58 +0200

Hi,

Thomas Frieden wrote:
I ran into a problem that is probably related to binutils. At one point, it generates wrong dwarf2 debug info. The faulty info is only in linked binaries, not in object files.

Answering myself here:

I had a look at what causes the problem. Quite frankly, it IS a but in the bintutils.

The debug hunk is correct in the object file generated by the compiler, but wrong in the linked binary:

Object file:

 <1><217>: Abbrev Number: 21 (DW_TAG_typedef)
     DW_AT_name        : (indirect string, offset: 0x68f7): Elf32_Off
     DW_AT_decl_file   : 8
     DW_AT_decl_line   : 41
     DW_AT_type        : <#0>
 <1><222>: Abbrev Number: 21 (DW_TAG_typedef)
     DW_AT_name        : (indirect string, offset: 0x4bd1): Elf32_Half
     DW_AT_decl_file   : 8
     DW_AT_decl_line   : 40
     DW_AT_type        : <#0>
 <1><22d>: Abbrev Number: 21 (DW_TAG_typedef)
     DW_AT_name        : (indirect string, offset: 0x2a9b): Elf32_Addr
     DW_AT_decl_file   : 8
     DW_AT_decl_line   : 39
     DW_AT_type        : <#0>
 <-2><23b>: Abbrev Number: 2 (DW_TAG_pointer_type)
     DW_AT_byte_size   : 17
     DW_AT_type        : <5000088>


Linked binary:

 <1><3e062>: Abbrev Number: 21 (DW_TAG_typedef)
     DW_AT_name        : (indirect string, offset: 0xd90c): Elf32_Off
     DW_AT_decl_file   : 8
     DW_AT_decl_line   : 41
     DW_AT_type        : <#3e935>
 <1><3e06d>: Abbrev Number: 21 (DW_TAG_typedef)
     DW_AT_name        : (indirect string, offset: 0xd708): Elf32_Half
     DW_AT_decl_file   : 8
     DW_AT_decl_line   : 40
     DW_AT_type        : <#3e94b>
 <1><3e078>: Abbrev Number: 21 (DW_TAG_typedef)
     DW_AT_name        : (indirect string, offset: 0xd5ae): Elf32_Addr
     DW_AT_decl_file   : 8
     DW_AT_decl_line   : 39
     DW_AT_type        : <#3e935>
 <-2><3e086>: Abbrev Number: 8 (DW_TAG_unspecified_parameters)
 <-2><3e087>: Abbrev Number: 9 (DW_TAG_subroutine_type)
     DW_AT_sibling     : <5de4c>
     DW_AT_prototyped  : 254
     DW_AT_type        : <d07df4c>

Note the wrong Abbrev number (DW_TAG_pointer_type in the object file, and DW_TAG_unspecified_parameters in the linked file). This results in subsequent data being "shifted" by four bytes, and thus, the next compilation unit has a wrong version number, which results in addr2line or gdb complaining...

I looked through the binutils bug database, but couldn't find any hint about this.


Regards, -- Thomas Frieden <ThomasF@xxxxxxxxxxxxxxxxxxxxxxxxxx> Hyperion Entertainment

várok ezen a helyen ahol a nap sosem süt
______________________________________________________________________________
Amiga Development tools ML - //www.freelists.org/list/adtools
Homepage...................: http://www.sourceforge.net/projects/adtools
Listserver help............: mailto:adtools-request@xxxxxxxxxxxxx?Subject=HELP

Other related posts: