This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Should the section address be ignored when processing DWARF information ?
Hi Nick & Eric,
On Apr 20 13:44, Nick Clifton wrote:
> >> 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.
The PE/COFF format on x86 Windows requires that every section in a file
starts on the next 4K boundary after the end of the previous section.
Therefore, even though debug sections are marked as NOLOAD sections,
they have to have a valid VMA address according to that rule. Otherwise
the Windows runtime loader complains that the binary is not a valid
executable image.
> So - Eric, Corinna - please could you try out the attached,
> alternative patch ?
Works fine for Cygwin.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat