delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
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 |
Message-ID: | <432AC9F5.4010603@familiehaase.de> |
Date: | Fri, 16 Sep 2005 15:34:45 +0200 |
From: | "Gerrit P. Haase" <gerrit AT familiehaase DOT de> |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.11) Gecko/20050728 |
MIME-Version: | 1.0 |
To: | Cygwin <cygwin AT cygwin DOT com> |
Subject: | Re: Bug in gcc and/or binutils? |
References: | <000701c5ba80$abb3ba70$e04861cb AT DANNY> |
In-Reply-To: | <000701c5ba80$abb3ba70$e04861cb@DANNY> |
X-IsSubscribed: | yes |
Danny Smith wrote: > References: <http://sources.redhat.com/ml/cygwin/2005-09/msg00471.html> > <http://sources.redhat.com/ml/cygwin/2005-09/msg00519.html> > > Charles Wilson <cygwin at cwilson dot fastmail dot fm> wrote: > > >>Using .def files turns off the auto-EXport logic (which it should, >>because if you specify a specific set of exports you don't want binutils >>adding a few more on its own). > > > There seems to be a common misconception that auto-export logic and > explicit designation of exports are incompatible. > You can still use --export-all (to get the auto-export of all defined > symbols) with a .def file or with __declspec(dllexport). > > eg > gcc -shared -ofoo.dll foo.def foo.c -Wl,--export-all But this does not help in the test case. The import libs are identical in regard to the symbol, with or without export-all flag, the executable linked with this import lib is broken. > The use of a def file (with --export-all) is useful when you want to > export all symbols but want special handling of some, say an alias or > marking a symbol as PRIVATE (exclude from import lib) or NONAME (exclude > the name of the symbol from the dll's export table), (almost like > __attribute__((hidden)) Or you may want to add a symbol that is just > forwarded to another dll. Or you have a function foo() but only want > the indirect ref __imp__foo visible in the import lib, and not the label: > > foo: > jmp * __imp__foo > > so you only export the pointer by marking as DATA in the def file So if you want export the pointer and use a .def file you must mark it as DATA, else it will not be exported. Though it is not exactly the problem, directly linking to the DLL succeeds with or without (wrong) .def file. Gerrit -- =^..^= -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |