changeset 20528:3f01c585f54e

oct-shlib.cc: Use RTLD_GLOBAL option for dlopen * oct-shlib.cc (octave_dlopen_shlib::octave_dlopen_shlib): Use RTLD_GLOBAL option for dlopen.
author Mike Miller <mtmiller@octave.org>
date Mon, 21 Sep 2015 17:15:17 +0200
parents ff904ae0285b
children fbbdd14aa7ce
files liboctave/util/oct-shlib.cc
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/oct-shlib.cc	Tue Sep 15 08:48:35 2015 -0400
+++ b/liboctave/util/oct-shlib.cc	Mon Sep 21 17:15:17 2015 +0200
@@ -195,6 +195,12 @@
   flags |= RTLD_NOW;
 #endif
 
+  // Use RTLD_GLOBAL to export symbols from loaded objects so they are
+  // available to other subsequently loaded libraries.
+#if defined (RTLD_GLOBAL)
+  flags |= RTLD_GLOBAL;
+#endif
+
   library = dlopen (file.c_str (), flags);
 
   if (! library)