From: Marc V. <vai...@fa...> - 2009-04-10 15:10:08
|
On Fri, Apr 10, 2009 at 02:11:09PM +0000, Earnie Boyd wrote: > Quoting Marc Vaillant <vai...@fa...>: > > > Symbols are exported by default from the DLL, so the macros are > > unnecessary. > > The caveat to this is that *all* symbols are exported. If you have > symbols that you don't want exported then you must declare which > should be. Also if you have a dependent dll bar used by dll foo then > the symbols of bar used by foo are exported with the symbols of foo. I thought that I had noticed this before but the ld manpage seems to suggest otherwise: --export-all-symbols --snip-- Also, symbols imported from other DLLs will not be re-exported, nor will symbols specifying the DLL's internal layout such as those beginning with "_head_" or ending with "_iname". --snip-- Also, I just tried it myself to confirm: libutilities1.dll has func() exported, libshared.dll has shared(). The following build of libshared.dll libshared.dll: shared.c utilities1/libutilities.dll $(CC) -o libshared.dll shared.c -lutilities -shared -Lutilities1 -Wl,--output-def,libshared.def produces the def file: EXPORTS shared @1 IMPORTS libutilities.dll.func Marc |