Mail Archives: djgpp/2006/03/06/12:13:33
This is a multi-part message in MIME format.
--------------000507060101090909090600
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Simon Peter kirjoitti:
> Hi,
>
> i got a strange problem with libstdcxx-using programs. I cross-compile
> from Linux with a self-built version of GCC 4.0.2. Whenever any
> iostreams-related feature is used, the program will crash at the
> ios_base constructor.
>
> The strange thing is that when looking at it with a debugger, the
> memory region where the ios_base constructor should be is completely
> zero, whereas the same region in the executable, examined with objdump,
> is the correct code.
I suspect incompatible linker scripts.
You may try attached patch for binutils-2.16.1 or my RPMs of
Linux-to-DJGPP cross-compiler, cross-binutils etc . tested on Fedora Core 4:
http://www.iki.fi/andris.pavenis/djgpp/gcc/cross-compiler
I'll shall put there sometime also SRPM of GCC-4.1.0 cross-compiler
(it's ready but not uploaded)
Andris
--------------000507060101090909090600
Content-Type: text/x-patch;
name="linker_script.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="linker_script.diff"
--- binutils-2.16.1/ld/scripttempl/i386go32.sc.linkscript 2005-11-16 10:35:54.000000000 +0200
+++ binutils-2.16.1/ld/scripttempl/i386go32.sc 2005-11-16 10:36:03.000000000 +0200
@@ -35,11 +35,16 @@
${RELOCATING+djgpp_first_ctor = . ;
*(SORT(.ctors.*))
*(.ctor)
+ *(.ctors)
djgpp_last_ctor = . ;}
${RELOCATING+djgpp_first_dtor = . ;
*(SORT(.dtors.*))
*(.dtor)
+ *(.dtors)
djgpp_last_dtor = . ;}
+ __environ = . ;
+ PROVIDE(_environ = .) ;
+ LONG(0) ;
*(.data)
${RELOCATING+*(.data.*)}
--------------000507060101090909090600--
- Raw text -