bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in Cygwin ld? Cannot load DLL exported symbols with dlopen/dlsym


From: fabrizio . ge
Subject: Bug in Cygwin ld? Cannot load DLL exported symbols with dlopen/dlsym
Date: Tue, 3 Dec 2002 01:40:38 +0100

I am building a DLL with Cygwin, using gcc 3.2 20020927 and GNU ld 2.13
20021118. To build the DLL, I use the command

gcc -shared -g -o <DLL file name> -Wl,--out-implib=<import library file
name> <source file name>

The DLL is built, and by default it seems that all symbols are exported
(unlike Microsoft compiler, where by default no symbols are exported). If
executables are compiled to use the DLL (implicit linking), they work. Also,
if an executable load the DLL with dlopen (explicit linking) any DLL's symbol
can be loaded with dlsym.

Then, I try to make a .def file, so not all the symbols are exported. The
DLL is rebuilt with

gcc -shared -g -o <DLL file name> -Wl,--out-implib=<import library file
name> <source file name> <.def file name>

Implicit link works. But, this time, dlsym often fails: only a subset of
the symbols can be loaded with dlsym, in other cases dlsym returns NULL.
The strange thing is, when building the dll with Microsoft's cl.exe and
the same .def file, dlsym works as it should.

Is the problem in ld? Or in bfd?


__________________________________________________________________
Tiscali ADSL. Scopri la fantastica promozione di Natale: tutto Gratis fino
al 9 gennaio!
Abbonati ora: prima ti abboni, piĆ¹ risparmi!
http://point.tiscali.it/adsl/index.shtml







reply via email to

[Prev in Thread] Current Thread [Next in Thread]