This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Import library for symbols decl. without dllimport
- From: Brian Dessent <brian at dessent dot net>
- 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>
- Date: Mon, 01 Sep 2008 19:53:13 -0700
- Subject: Re: Import library for symbols decl. without dllimport
- References: <48BC9E64.3040701@tdragon.net>
- Reply-to: 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/