From 5db682d928379c9d3db8a704dcdffa8756bd92ee Mon Sep 17 00:00:00 2001 From: Leif Hedstrom Date: Thu, 5 Mar 2020 11:30:44 -0700 Subject: [PATCH] Be explicit about RTLD_LOCAL, defaults varies on platforms --- proxy/http/remap/PluginDso.cc | 2 +- proxy/http/remap/unit-tests/test_PluginFactory.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/http/remap/PluginDso.cc b/proxy/http/remap/PluginDso.cc index eb4a895258c..6096a7f49a7 100644 --- a/proxy/http/remap/PluginDso.cc +++ b/proxy/http/remap/PluginDso.cc @@ -90,7 +90,7 @@ PluginDso::load(std::string &error) PluginDebug(_tag, "plugin '%s' mоdification time %ld", _configPath.c_str(), _mtime); /* Now attemt to load the plugin DSO */ - if ((_dlh = dlopen(_runtimePath.c_str(), RTLD_NOW)) == nullptr) { + if ((_dlh = dlopen(_runtimePath.c_str(), RTLD_NOW | RTLD_LOCAL)) == nullptr) { #if defined(freebsd) || defined(openbsd) char *err = (char *)dlerror(); #else diff --git a/proxy/http/remap/unit-tests/test_PluginFactory.cc b/proxy/http/remap/unit-tests/test_PluginFactory.cc index faa7e6fa813..8623df0b5a6 100644 --- a/proxy/http/remap/unit-tests/test_PluginFactory.cc +++ b/proxy/http/remap/unit-tests/test_PluginFactory.cc @@ -136,7 +136,7 @@ class GlobalPluginInfo { CHECK(fs::exists(configPath)); - void *handle = dlopen(configPath.c_str(), RTLD_NOW); + void *handle = dlopen(configPath.c_str(), RTLD_NOW | RTLD_LOCAL); if (!handle) { return false; }