Should the section address be ignored when processing DWARF information ?

Nick Clifton nickc@redhat.com
Fri Apr 20 12:51:00 GMT 2007


Hi Eric, Hi Corinna,

>>   Does Mach-O need to have the section address added in to the offset
>>   calculation when processing DWARF information ?
> 
> Right now dwarf information is only used in object files which are a 
> single "section", that then the actual sections are offsets within that 
> so unfortunately, yes, it needs the section address added into the 
> offset calculation when processing dwarf in object files.

Darn.

> Out of 
> curiosity what is the section offset in the coff/pe files? I would think 
> it would be something similar...

Corinna can probably answer this better than I, but I believe that the 
dwarf sections in PE files are given addresses after the end of all the 
other data.  (See ld/scripttempl/pe.sc).  They do not have the Mach-O 
problem however, because the offsets are all section relative to the 
start of the real debug sections, not Mach-O's mega-section.


So - Eric, Corinna - please could you try out the attached, alternative 
patch ?  It changes the value computed for the "address" field of the 
dwarf_section structure to be 0 for all targets, except the Mach-O. 
(Well at least that is its intention...)  So that in theory the current 
code in dwarf.c will continue to add in the section address for Mach-O, 
but no longer use it for Cygwin.

Cheers
   Nick


-------------- next part --------------
A non-text attachment was scrubbed...
Name: objdump.c.patch
Type: text/x-patch
Size: 1477 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070420/65739c7e/attachment.bin>


More information about the Binutils mailing list