diff --git a/binding/Binding.Shared/LibraryLoader.cs b/binding/Binding.Shared/LibraryLoader.cs index 428e3ce2ca3..cdaca5b2334 100644 --- a/binding/Binding.Shared/LibraryLoader.cs +++ b/binding/Binding.Shared/LibraryLoader.cs @@ -202,16 +202,17 @@ private static class Linux private const int RTLD_LAZY = 1; private const int RTLD_NOW = 2; + private const int RTLD_DEEPBIND = 8; private static bool UseSystemLibrary2 = true; public static IntPtr dlopen (string path, bool lazy = true) { try { - return dlopen2 (path, lazy ? RTLD_LAZY : RTLD_NOW); + return dlopen2 (path, (lazy ? RTLD_LAZY : RTLD_NOW) | RTLD_DEEPBIND); } catch (DllNotFoundException) { UseSystemLibrary2 = false; - return dlopen1 (path, lazy ? RTLD_LAZY : RTLD_NOW); + return dlopen1 (path, (lazy ? RTLD_LAZY : RTLD_NOW) | RTLD_DEEPBIND); } }