dlsym() on implicit loaded symbols

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Sun Jul 16 12:33:13 UTC 2006

Roland Dittel wrote:
>>> We have a issue with dlsym() on symbols imported by a library that 
>>> was loaded with dlopen(). Our code loads the libssl with dlopen() and 
>>> then do a dlsym() on several symbols. This works for all symbols 
>>> exported by libssl itself but fails for symbols exported by 
>>> libcrypto.
>       func = dlsym(handle, "CRYPTO_set_id_callback");

you have to use RTLD_DEFAULT instead of handle, but I agree, this is not in conformance with SUSv3:

    The dlsym() function shall search for the named symbol in all objects loaded automatically as a result of loading the object referenced by handle (see dlopen()). Load ordering is used in dlsym() operations upon the global symbol object. The symbol resolution algorithm used shall be dependency order as described in dlopen().

    The RTLD_DEFAULT and RTLD_NEXT flags are reserved for future use.

Note "in all objects loaded automatically".  Good catch!


Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060716/10f91800/signature.pgp

More information about the freebsd-hackers mailing list