<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6249.1">
<TITLE>Re: [PATCH] gcc3/ld patch for direct-linking-to-dll and auto-import support</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi Ralf,<BR>
<BR>
&gt; while compiling trolltechs qt/xfree library with gcc3 (3.2x) on<BR>
&gt; cygwin I recognized, that the auto-import stuff in combination of<BR>
&gt; recent ld does not work in case of const variables in a dll when<BR>
&gt; using direct linking to a dll, because gcc put those variables into<BR>
&gt; a readonly, that means the .text section.<BR>
&gt;<BR>
&gt; The patch and a testcase is appended. A documentation could be found<BR>
&gt; in the patch file.<BR>
<BR>
Are you sure that the current linker does not work ?<BR>
<BR>
When I tried it, using the test case you supplied, but without the<BR>
patch applied, I got this:<BR>
<BR>
&nbsp; % make<BR>
&nbsp; ../gcc/g++ -B ../gcc/ -g&nbsp; -save-temps -c -o dll.o dll.cc<BR>
&nbsp; ../gcc/g++ -B ../gcc/ -g&nbsp; --shared -L ./i686-pc-cygwin/newlib -L ../i686-pc-cygwin/libstdc++-v3/src/.libs dll.o -o dll.dll<BR>
&nbsp; ../gcc/g++ -B ../gcc/ -g&nbsp; -save-temps -c -o client.o client.cc<BR>
&nbsp; ../gcc/g++ -B ../gcc/ -g&nbsp; -o client client.o -L ./i686-pc-cygwin/newlib -L ../i686-pc-cygwin/libstdc++-v3/src/.libs -L. -ldll<BR>
&nbsp; Info: resolving _var by linking to __imp__var (auto-import)<BR>
&nbsp; Info: resolving test::var&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by linking to __imp___ZN4test3varE (auto-import)<BR>
<BR>
Cheers<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nick<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<BR>
<BR>
--<BR>
Unsubscribe info:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://cygwin.com/ml/#unsubscribe-simple">http://cygwin.com/ml/#unsubscribe-simple</A><BR>
Problem reports:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://cygwin.com/problems.html">http://cygwin.com/problems.html</A><BR>
Documentation:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://cygwin.com/docs.html">http://cygwin.com/docs.html</A><BR>
FAQ:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://cygwin.com/faq/">http://cygwin.com/faq/</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>