X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <440C6D77.1090503@iki.fi> Date: Mon, 06 Mar 2006 19:12:23 +0200 From: Andris Pavenis User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: djgpp AT delorie DOT com, dn DOT tlp AT gmx DOT net Subject: Re: Problems with cross-compiled iostreams-using programs References: <1141636217 DOT 753388 DOT 261560 AT e56g2000cwe DOT googlegroups DOT com> In-Reply-To: <1141636217.753388.261560@e56g2000cwe.googlegroups.com> Content-Type: multipart/mixed; boundary="------------000507060101090909090600" Reply-To: djgpp AT delorie DOT com 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--