set RTLD_LOCAL for dlopen() when opening a module

This commit is contained in:
hyung-hwan 2020-10-20 07:41:56 +00:00
parent 78deb3a44d
commit b17dfeea3c

View File

@ -341,7 +341,7 @@ void* hawk_stdmodopen (hawk_t* hawk, const hawk_mod_spec_t* spec)
lt_dladvise_ext (&adv); lt_dladvise_ext (&adv);
/*lt_dladvise_resident (&adv); useful for debugging with valgrind */ /*lt_dladvise_resident (&adv); useful for debugging with valgrind */
h = lt_dlopenadvise (modpath, adv); h = lt_dlopenadvise(modpath, adv);
lt_dladvise_destroy (&adv); lt_dladvise_destroy (&adv);
@ -498,7 +498,7 @@ void* hawk_stdmodopen (hawk_t* hawk, const hawk_mod_spec_t* spec)
#endif #endif
if (!modpath) return HAWK_NULL; if (!modpath) return HAWK_NULL;
h = dlopen(modpath, RTLD_NOW); h = dlopen(modpath, RTLD_NOW | RTLD_LOCAL);
if (!h) hawk_seterrfmt (hawk, HAWK_NULL, HAWK_ESYSERR, HAWK_T("%hs"), dlerror()); if (!h) hawk_seterrfmt (hawk, HAWK_NULL, HAWK_ESYSERR, HAWK_T("%hs"), dlerror());
hawk_freemem (hawk, modpath); hawk_freemem (hawk, modpath);