www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/09/01/22:53:58

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48BCAA99.1741FFB5@dessent.net>
Date: Mon, 01 Sep 2008 19:53:13 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: "John E. / TDM" <tdragon AT tdragon DOT net>
CC: cygwin AT cygwin DOT com, MinGW Users List <mingw-users AT lists DOT sourceforge DOT net>
Subject: Re: Import library for symbols decl. without dllimport
References: <48BC9E64 DOT 3040701 AT tdragon DOT net>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

"John E. / TDM" wrote:

> This of course works fine, but it's sub-optimal; I would like for the
> message not to be displayed at all, and I imagine that the auto-import
> machinery shouldn't even need to be activated if the import library for
> the libstdc++ DLL is properly designed. Also, hiding the message with
> --enable-auto-import would also hide similar messages from other
> libraries that I *would* want to see.

That's just not how it works for data imports.  For functions yes, but
not for data imports.  You either use auto-import or you
__declspec(dllimport).  It works for functions because the call can go
through a thunk stub.  But for data variables not marked
__declspec(dllimport), there's no indirection; the only way to add the
required indirection (to make the reference to a symbol in another
module whose address isn't known until runtime) is to trick the
operating system loader into modifying the text section at runtime which
is what auto-import does.  There's no way to simulate this with just an
import library as is possible with function thunks.

Brian

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019