namespace fedem::dso {
class DSOLoader;
}
Defined in <dso/DSOLoader.hh>. Link dsold.
DSOLoader cannot be constructed — every constructor, the destructor and assignment are = delete. It is a set of static functions over one static std::mutex and one process-wide handle set.
Static member functions
| Function | Page |
|---|---|
load( soName ), load( soName, dirs ) | DSOLoader::load |
loadAll( ext ), loadAll( ext, folder ), loadAll( ext, dirs ) | DSOLoader::loadAll, ::loadAllByEnvironment |
loadAllByEnvironment( ext ), loadAllByEnvironment( ext, env ) | DSOLoader::loadAll, ::loadAllByEnvironment |
prefix( pre ), prefix() | DSOLoader::prefix |
loadSigned(...), loadVerified(...) — with DSOLD_WITH_SIGN | DSOLoader::loadSigned, ::loadVerified |
Behaviour common to all load paths
dlopenflags:RTLD_GLOBAL | RTLD_LAZY. Global scope makes the host's catalog symbol and one plugin's symbols visible to the next; lazy binding defers relocations.- Handle lifetime: each successful
dlopenhandle is stored in a file-localstd::set; the set's destructordlcloses them all at process exit. There is no publicunload. - Idempotent: re-loading a file returns the same handle (
dlopenreference-counts) and re-runs nothing. - Locking: every call takes the
static std::mutex— concurrent loads are serialised. - Static initialisers run on load — this is when a plugin's
REGISTERobjects populate the catalog.
Signed overloads
loadSigned and loadVerified exist only when dsold was built with plugin-sign (the CMake build defines DSOLD_WITH_SIGN). Without it the class has just the plain load functions. See loadSigned / loadVerified.
Minimal use
#include <dso/DSOLoader.hh>
using fedem::dso::DSOLoader;
DSOLoader::prefix( "lib" );
DSOLoader::loadAll( ".so", "/opt/app/plugins" );

