From c6aad575171d4749d1ef2b5fc7c9fd7c32c1c59f Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Tue, 19 Dec 2017 22:35:53 +0530 Subject: Use RTLD_LOCAL for symbol resolution RTLD_LOCAL is the default value for symbol visibility flag of dlopen() in Linux and NetBSD. Using it avoids conflicts during symbol resolution. This also allows us to detect xlators that have not been explicitly linked with libraries that they use. This used to go unnoticed when RTLD_GLOBAL was being used. BUG: 1193929 Change-Id: I50db6ea14ffdee96596060c4d6bf71cd3c432f7b Signed-off-by: Prashanth Pai --- libglusterfs/src/xlator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 3e9814ca19..b060d39373 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -170,7 +170,7 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle, gf_msg_trace ("xlator", 0, "attempt to load file %s", name); - handle = dlopen (name, RTLD_NOW|RTLD_GLOBAL); + handle = dlopen (name, RTLD_NOW); if (!handle) { gf_msg ("xlator", GF_LOG_WARNING, 0, LG_MSG_DLOPEN_FAILED, "%s", dlerror ()); @@ -427,7 +427,7 @@ xlator_dynload (xlator_t *xl) gf_msg_trace ("xlator", 0, "attempt to load file %s", name); - handle = dlopen (name, RTLD_NOW|RTLD_GLOBAL); + handle = dlopen (name, RTLD_NOW); if (!handle) { gf_msg ("xlator", GF_LOG_WARNING, 0, LG_MSG_DLOPEN_FAILED, "%s", dlerror ()); -- cgit