[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dlsym() "feature" ?
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: dlsym() "feature" ?
- From: Matthieu Herrb <Mathieu_(_dot_)_Herrb_(_at_)_mipnet_(_dot_)_fr>
- Date: Fri, 27 Sep 1996 23:06:12 +0200 (MET DST)
- Reply-to: Mathieu_(_dot_)_Herrb_(_at_)_mipnet_(_dot_)_fr
Hi,
While testing dynamically loaded modules for a future XFree86 release,
I discovered a strange feature of the dlsym() function. The man page
says:
dlsym() looks for a definition of symbol in the shared object designated
by handle.
but in fact the look-up is done in the whole executable. This means
that several modules cannot share symbols. For example, in XFree86,
all modules use a common 'init_module' symbol to handle the module
initialization; this doesn't work with OpenBSD.
After the first module is loaded with dlopen(), all calls to
dlsym(handle, "_init_module") return the same init_module address.
Is this behaviour intentional or can it be corrected ?
Thanks in advance.
Matthieu
Visit your host, monkey.org