I'm using dlopen / dlclose to load lib with glibc 2.21.
Is there a C++ call to check a lib as a DF_1_NODELETE flag set ? readelf seems to be able to do it.
or at least if a lib has unique symbol defined in it ? nm is definitely able to do it.
ideally i would like something like :
CloseLib( libHandle lib)
{
if( checkIfLibIsClosable(lib) )
{
dlclose(lib)
}
}
This is in order to avoid calling dlclose on lib with DF_1_NODELETE flag, as calling it will fails with an assert error :
Inconsistency detected by ld.so: dl-close.c: 764: _dl_close: Assertion `map->l_init_called' failed!
which is caused by DF_1_NODELETE flag set in dl-close.c:762, The flag is set in dl-lookup.c:332
Info about DF_1_NODELETE flag and unique symbol :