The default behavior of dlopen() assumes RTLD_GLOBAL which means all symbols loaded wind up in the loading image’s global namespace. I am thinking HDF5 should be including RTLD_LOCAL to prevent that because the loading image could be using lib(s) (but different versions) the plugin is compiled with explicitly as well.
This man page indicates that RTLD_LOCAL is a default
This is the converse of RTLD_GLOBAL, and the default if
neither flag is specified. Symbols defined in this shared
object are not made available to resolve references in
subsequently loaded shared objects.
But maybe I am missing something…or are you suggesting to add to the parameters to be precise?
One of the following flags may be ORed into the mode argument:
RTLD_GLOBAL Symbols exported from this image (dynamic library or bundle)
will be available to any images build with -flat_namespace
option to ld(1) or to calls to **dlsym**() when using a special
RTLD_LOCAL Symbols exported from this image (dynamic library or bundle)
are generally hidden and only availble to **dlsym**() when
directly using the handle returned by this call to **dlopen**().
If neither RTLD_GLOBAL nor RTLD_LOCAL is specified, the default is
Seems like it should be set explicitly, since it varies across systems. :-/