Subject: Re: Support for DDWARF-2 debug info? (on Cygwin)
From: Nick Clifton <[email-masked]>
To: Brian Ford <[email-masked]>
Cc: [email-masked], <[email-masked]>, <[email-masked]>, <[email-masked]>
Date: 16 Jan 2003 15:58:09 +0000

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.

Cheers
       Nick

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/