This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: dlopen/dlclose problems
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Andreas Fink <andreas dot fink85 at googlemail dot com>
- Cc: libc-help at sourceware dot org
- Date: Sat, 27 Nov 2010 10:05:16 -0500
- Subject: Re: dlopen/dlclose problems
- References: <20101125234642.60149772@jocker-laptop>
On Thu, Nov 25, 2010 at 5:46 PM, Andreas Fink
<andreas.fink85@googlemail.com> wrote:
> Is this a bug or intended behaviour (if it is intended can you tell me why?)
It is not a bug. The use dlclose() does not require that the
implementation remove the object from the address space. In fact it
would probably be a waste of time.
POSIX says:
~~~
The use of dlclose() reflects a statement of intent on the part of the
process, but does not create any requirement upon the implementation,
such as removal of the code or symbols referenced by handle. Once an
object has been closed using dlclose() an application should assume
that its symbols are no longer available to dlsym(). All objects
loaded automatically as a result of invoking dlopen() on the
referenced object are also closed.
~~~
Your application shouldn't care if the DSO is removed from the address space.
I will ask you the same question I ask everyone:
What problem are you trying to solve?
Cheers,
Carlos.