I have the following setup:

Main executable loads module X, which in turn loads modules Y.so and Z.so
(optionally, depending on the configuration). All loads are done with 
dlopen with flags RTLD_LAZY|RTLD_GLOBAL. Now, module Y needs to know 
address of some symbol from module Z in case Z.so is loaded. On linux and 
solaris, the code along these lines works:

 void *this_module = dlopen(NULL, RTLD_LAZY|RTLD_GLOBAL);
 return dlsym(this_module, symbol_name);

However, on FreeBSD 3.4 and 4.0 it doesn't work - the dlsym returns NULL.
The question is - how to make it work? I know that latest FreeBSD versions
have dlsym(RTLD_DEFAULT, symbol_name), which is supposed to help. However, 
I need it to work on 3.4 and 4.0 too. What can be done about this? Is 
there any alternative way of doing this? The problem is that module Y 
doesn't also know the full path for Z.so, though it can know if it was 
loaded or not - thus I can not use dlopen with path name to go directly to 
Z.so. Any suggestions? 

-- 
Stanislav Malyshev, Zend Products Engineer   
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.109



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to