This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug in Cygwin ld?


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]