Bug in Cygwin ld?

fabrizio_ge-wolit@tiscali.it fabrizio_ge-wolit@tiscali.it
Wed Dec 4 09:05:00 GMT 2002


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





More information about the Binutils mailing list