[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dlsym() "feature" ?



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