This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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]

Non-zero VMA's w/DWARF-2?


I am trying to add DWARF-2 support to Cygwin.

I have run into the problem that all example DWARF-2 implementations seem
to expect the .debug_* sections' VMAs to be zero.  This contradicts the
PE/coff object format as I read it, and the resulting executable will not
run.

>From "Microsoft Portable Executable and Common Object File Format
Specification 6.0":

4.) Section Table (Section Headers)

In an image file, the virtual addresses for sections must be assigned by
the linker such that they are in ascending order and adjacent, and they
must be a multiple of the Section Align value in the optional header.

and

5. Other Contents of the File

The remainder of a COFF object or image file contains blocks of data that
are not necessarily at any specific file offset. Instead the locations are
defined by pointers in the Optional Header or a section header.

[...]

Another exception is that attribute certificate and debug information
must be placed at the very end of an image file (with the attribute
certificate table immediately preceding the debug section), because the
loader does not map these into memory. The rule on attribute certificate
and debug information does not apply to object files, however.

Am I reading this wrong?  Who's the PE expert?  Is there any hope of
non-zero VMAs for .debug_* sections?

Thanks.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444


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