Question about "gnu.linkonce.wi." sections

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about "gnu.linkonce.wi." sections

Ivan Pantushev
Hello,

I am decoding the debugging information in an Elf/Dwarf_2 file and there are references to type information in ".gnu.linkonce.wi.*" sections which I don't know how to resolve (binutils 2.16.1 and gcc 4.0.2 were used).

Here is a part of the ".debug_info" section:
   Compilation Unit @ 0:
    Length:        79
    Version:       2
    Abbrev Offset: 0
    Pointer Size:  4
  <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
      DW_AT_stmt_list   : 0
      DW_AT_low_pc      : 0x100000
      DW_AT_high_pc     : 0x100090
      DW_AT_name        : startup.gas
      DW_AT_comp_dir    : d:\test
      DW_AT_producer    : GNU AS 2.16.1
      DW_AT_language    : 32769 (MIPS assembler)
   Compilation Unit @ 53:
    Length:        235
    Version:       2
    Abbrev Offset: 20
    Pointer Size:  4
  <0><5e>: Abbrev Number: 3 (DW_TAG_compile_unit)
      DW_AT_macro_info  : 0
      DW_AT_stmt_list   : 98
      DW_AT_high_pc     : 0x100090
      DW_AT_low_pc      : 0x100090
      DW_AT_producer    : GNU C 4.0.2 -g
      DW_AT_language    : 1 (ANSI C)
      DW_AT_name        : board.c
      DW_AT_comp_dir    : d:\test
  - - -
  <1><c2>: Abbrev Number: 6 (DW_TAG_array_type)
      DW_AT_sibling     : <d2>
      DW_AT_type        : <#19>

The last DW_AT_type references type information at offset 0x19, but there is no such information in the .debug_info section.

There are 18 ".gnu.linkonce.wi.FILENAME.h.*" sections and there is a type info at offset 19 in each of them (instead of * there is a hexadecimal number like b10c314a for example).

How do I find out which ".gnu.linkonce.wi.FILENAME.h.*" section is the one to be used for the type information (of the array type at offset 0xc2 in the ".debug_info" section)?

Thank you for your time.

Greetings,
Ivan Pantushev

--
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/

Reply | Threaded
Open this post in threaded view
|

Re: Question about "gnu.linkonce.wi." sections

Daniel Jacobowitz-2
[I feel like I've answered this question recently, but I can't remember
where...]

On Mon, Nov 07, 2005 at 03:05:53AM -0500, Ivan Pantushev wrote:
>   <1><c2>: Abbrev Number: 6 (DW_TAG_array_type)
>       DW_AT_sibling     : <d2>
>       DW_AT_type        : <#19>
>
> The last DW_AT_type references type information at offset 0x19, but
> there is no such information in the .debug_info section.

#19 means that this is a reference to another compilation unit.  You
are looking at an unlinked object file.  That means that there are
unapplied relocations; take a look at the readelf -r output and you can
work out which section the relocation at that offset is targetting.  If
there's no relocation, it's the current section.

Readelf doesn't have any way to print out relocations for dwarf
decoding.  It is more effective on linked objects.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: Question about "gnu.linkonce.wi." sections

Ivan Pantushev
In reply to this post by Ivan Pantushev
> #19 means that this is a reference to another compilation unit.  You
> are looking at an unlinked object file.  That means that there are
> unapplied relocations; take a look at the readelf -r output and you can
> work out which section the relocation at that offset is targetting.  If
> there's no relocation, it's the current section.

The output of the "readelf -r" is "There are no relocations in this file.".

If by "current section" you mean the ".debug_info" then there is no type
information at offset 0x19. The first compile unit starts at offset 0 and
the second at offset 0x53. There is nothing between them.

Ivan Pantushev

--
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/

Reply | Threaded
Open this post in threaded view
|

Re: Question about "gnu.linkonce.wi." sections

Daniel Jacobowitz-2
On Mon, Nov 07, 2005 at 09:31:58AM -0500, Ivan Pantushev wrote:

> > #19 means that this is a reference to another compilation unit.  You
> > are looking at an unlinked object file.  That means that there are
> > unapplied relocations; take a look at the readelf -r output and you can
> > work out which section the relocation at that offset is targetting.  If
> > there's no relocation, it's the current section.
>
> The output of the "readelf -r" is "There are no relocations in this file.".
>
> If by "current section" you mean the ".debug_info" then there is no type
> information at offset 0x19. The first compile unit starts at offset 0 and
> the second at offset 0x53. There is nothing between them.

Please send me this object file offlist.

--
Daniel Jacobowitz
CodeSourcery, LLC