Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: Ralf.Habacker@freenet.de
Cc: binutils@sources.redhat.com, cygwin@cygwin.com, kde-cygwin@kde.org
Subject: Re: [PATCH] gcc3/ld patch for direct-linking-to-dll and auto-import
 support
References: <004d01c36d9e$e7433e70$ca5e07d5@BRAMSCHE>
From: Nick Clifton <nickc@redhat.com>
Date: Sun, 07 Sep 2003 19:30:40 +0100
In-Reply-To: <004d01c36d9e$e7433e70$ca5e07d5@BRAMSCHE> (Ralf Habacker's
 message of "Thu, 28 Aug 2003 21:59:34 +0200")
Message-ID: <m38yp0cuy7.fsf@redhat.com>
User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

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/

