From b17dfeea3c8c3e96979e05ff812eced32d15f95b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 20 Oct 2020 07:41:56 +0000 Subject: [PATCH] set RTLD_LOCAL for dlopen() when opening a module --- hawk/lib/std.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hawk/lib/std.c b/hawk/lib/std.c index b3f623fd..d805c3dd 100644 --- a/hawk/lib/std.c +++ b/hawk/lib/std.c @@ -341,7 +341,7 @@ void* hawk_stdmodopen (hawk_t* hawk, const hawk_mod_spec_t* spec) lt_dladvise_ext (&adv); /*lt_dladvise_resident (&adv); useful for debugging with valgrind */ - h = lt_dlopenadvise (modpath, adv); + h = lt_dlopenadvise(modpath, adv); lt_dladvise_destroy (&adv); @@ -498,7 +498,7 @@ void* hawk_stdmodopen (hawk_t* hawk, const hawk_mod_spec_t* spec) #endif 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()); hawk_freemem (hawk, modpath);