This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Problems with Stabs in DLLs



   I have a problem with the default cygwin linker script:

  the .reloc section is put before the .stab section,
but if you compile a DLL using -gstabs
there are entries in the .stab section which need relocation.

  The problem is that these entries are wrong calculated because 
as the .reloc section will be inserted just before the .stab section
you finally "relocate" values inside the .reloc section itself !!!

  I think this is a bug !
  The problem is that it only shows up if you load a DLL at a base address
different from the default base address.

  Solution to the above problem :

  There are in my opinion only two solutions to the above problem :

 1) Put .stab section  before .reloc section in the linker scripts
This needs to remove the NOLOAD attribute of course
and thus leads to bigger memory use, but don't forget that
all that is just ment for debugging purposes !!

  2) Change the .stab output so it uses .rva symbol references
which would avoid the relocation problem.
  But this would mean that we need to change GDB stabs loading mecanism 
(at well as other things like the commercial Cygwin Debugger !)

  I would like to hear comments about my problem!

PS : Don't tell I should use another debugging format,
because I am using and developping  FPC
(Free Pascal Compiler) that uses Cygwin tool to create Win32 executable.
And FPC only supports stabs debugging format
(I wrote the corresponding code !)


Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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