Support for DDWARF-2 debug info? (on Cygwin)

Nick Clifton
Thu Jan 16 15:59:00 GMT 2003

Hi Brian,

> My current problem is that all previous DWARF2 implementations
> assign a VMA of zero to the .debug_* sections in the link script.
> This violates the PE format and makes the executable unusable.

I saw your post about this to the binutils list.

Does the PE format require that the debugging sections be loaded into
memory when the executable is invoked ?  The reason that the ELF
format allows the .debug sections to have a VMA of zero is that they
also do not have the ALLOC flag, so they are not loaded into memory.
(A debugger wanting to access the sections for a running process must
locate the executable on disk an load them/mmap them from there).

> I am still consulting the DWARF2 spec to see if gcc and gas are
> correct in generating VMA addresses.  If so, I guess I have to fix
> the dwarf parsing code in bfd and gdb to subtract the section base
> VMA.

I do not believe that the DWARF2 spec mandates the VMA addresses of
the .debug sections.  It does say that their contents must be
contiguous, and it does specify the meaning of their contents, but it
does not specify the meaning of partially-complete .debug sections.
(ie ones attached to relocations that have not yet been resolved).

So, I think it is the case that BFD and GDB are both assuming that the
VMA of the sections will be zero, but that this is not required.


More information about the Binutils mailing list