Quoting Jeremy Chadwick <[EMAIL PROTECTED]>:

I know that the .so's you're loading with dlopen() need to be built a
specific way/with certain arguments, otherwise they won't work (I
believe what I saw was dlsym() returning NULL).  My symbol names were
getting stomped on, and there was a compiler flag that addressed that.


Is that a BSD-specific problem? As mentioned previously, I don't run into trouble on other platforms. Is there any documentation available which tells me how to build a dlopen()'able object in a portable way?

function_pointer = dlsym(RTLD_DEFAULT, "function_name");

Why is that? Or rather: what am I doing wrong?

This code right here is *completely* wrong.  RTLD_DEFAULT is a mode bit
for dlopen().  I'm willing to bet a strict set of warnings would

Citing the FreeBSD dlsym(3) man page:

"If dlsym is called with the special handle RTLD_DEFAULT, the search for the symbol follows the algorithm used for resolving undefined symbols when objects are loaded."

You probably had RTLD_LAZY and RTLD_NOW in mind which are dlopen() flags. BTW RTLD_NEXT works just as well instead of RTLD_DEFAULT.

regards,
Markus

--
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to