This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] gcc3/ld patch for direct-linking-to-dll and auto-importsupport
- From: Nick Clifton <nickc at redhat dot com>
- To: Ralf dot Habacker at freenet dot de
- Cc: binutils at sources dot redhat dot com, cygwin at cygwin dot com, kde-cygwin at kde dot org
- Date: Sun, 07 Sep 2003 19:30:40 +0100
- Subject: Re: [PATCH] gcc3/ld patch for direct-linking-to-dll and auto-importsupport
- References: <004d01c36d9e$e7433e70$ca5e07d5@BRAMSCHE>
Hi Ralf,
> while compiling trolltechs qt/xfree library with gcc3 (3.2x) on
> cygwin I recognized, that the auto-import stuff in combination of
> recent ld does not work in case of const variables in a dll when
> using direct linking to a dll, because gcc put those variables into
> a readonly, that means the .text section.
>
> The patch and a testcase is appended. A documentation could be found
> in the patch file.
Are you sure that the current linker does not work ?
When I tried it, using the test case you supplied, but without the
patch applied, I got this:
% make
../gcc/g++ -B ../gcc/ -g -save-temps -c -o dll.o dll.cc
../gcc/g++ -B ../gcc/ -g --shared -L ../i686-pc-cygwin/newlib -L ../i686-pc-cygwin/libstdc++-v3/src/.libs dll.o -o dll.dll
../gcc/g++ -B ../gcc/ -g -save-temps -c -o client.o client.cc
../gcc/g++ -B ../gcc/ -g -o client client.o -L ../i686-pc-cygwin/newlib -L ../i686-pc-cygwin/libstdc++-v3/src/.libs -L. -ldll
Info: resolving _var by linking to __imp__var (auto-import)
Info: resolving test::var by linking to __imp___ZN4test3varE (auto-import)
Cheers
Nick
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/