dlopen/dlclose problems

Andreas Fink andreas.fink85@googlemail.com
Thu Nov 25 22:46:00 GMT 2010


Hello,

I have a dlopen/dlclose problem with the attached programs. The first line is a command line for building the test-library and
the test-program.

The problem description:
When having a static variable in a template function it seems to be impossible to dlclose the library again (tested with
glibc-2.12.1). Can anyone else confirm this behaviour?

How to reproduce:
Build the test library with 'g++ -shared -fPIC -O0 -o libtest.so libtest.cpp' (I think for 32-bit you do not need -fPIC)
Build the test program with 'g++ -ldl -o test_dlopen test_dlopen.cpp'
Run the test program (as argument the library path which should be dlopened can be given). Watch which libraries are mappend for
the process before dlopen, after dlopen and after dlclose. I expect that after dlclose the library is not loaded anymore, however
it still is.

Is this a bug or intended behaviour (if it is intended can you tell me why?)

Regards
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libtest.cpp
Type: text/x-c++src
Size: 169 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-help/attachments/20101125/075f31d1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_dlopen.cpp
Type: text/x-c++src
Size: 874 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-help/attachments/20101125/075f31d1/attachment-0001.bin>


More information about the Libc-help mailing list