From: Christopher Faylor <cgf@re...> - 2001-09-19 02:56:15
On Tue, Sep 18, 2001 at 02:32:26PM -0700, Jim Barton wrote:
>Does mingw support the use of weak symbols? Is there a special
>incantation needed to turn them on?
I don't think that the windows run-time loader understands the concept
of weak symbols. The option is definitely not available in the mingw
From: George Garvey <tmwg-mw@in...> - 2001-09-19 13:58:03
We use them here in .a libraries. I don't know what happens when they're
in a DLL. They're a pain with C++, but they work as far as I can tell.
Our use is for virtual functions that are only used in some
applications, but are quite large. A weak symbol for the function is
defined in one library, and the real virtual function is defined in another
library, which is only linked when the virtual functions are actually used.
Works for that purpose.
I suspect that there is a better way, but here's an excerpt from the
file where we define the weak symbols for inclusion in the smaller library:
We've had no use for weak symbols for data, so I've never looked into
extern __typeof ( CTP_weak ) F __attribute__ ((weak, alias ("CTP_weak")))
extern __typeof ( CTP_weak_false ) F __attribute__ ((weak, alias ("CTP_weak_false")))