GDB a VFS module
Henrik Nordstrom
hno at squid-cache.org
Fri Apr 23 19:26:05 GMT 2004
On Fri, 23 Apr 2004, Jagan wrote:
> I was able to resolve it by changing
> do_smb_load_module->dlopen to take in RTLD_NOW instead
> of RTLD_LAZY. This made the references resolved at
> load time. Funnily resolving a .a reference at run
> time doesnt seem to work.
A .a time must be linked at link time. It is not possible to link a .a
file at runtime as it is not a shared object.
Resolving this by changing the dlopen flag makes no sense to me. The
difference between RTLD_NOW and RTLD_LAZY is that RTLD_NOW will completely
fail loading the module if not all dependencies can be solved, while
RTLD_LAZY will suceed in loading the module and then fail when the
function using the missing dependency is called..
I would suspect what happened is that you now got the module linked
correctly, and this conincided with your change in dlopen.
But there is one other slight possibility I have not considered and which
I am not sure about. Maybe, but just mabye ther can be a difference if
your object depends on other shared libraries. I think that if RTLD_NOW is
used then these shared libraries will be linked privately to the object,
but if RTLD_LAZY is used then these shared libraries will then be linked
as RTLD_GLOBAL which may maybe (but just maybe) cause conflict with the
same symbols in other libraries preventing them from being loaded.. but I
am not sure.
What does ldd report on your module object?
Regards
Henrik
More information about the samba-technical
mailing list