summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadDl.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-22 10:10:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-22 10:10:05 (GMT)
commitb9f74bb43e5903dbe3fadd8c4d382c1724ee883f (patch)
treefed1fb5e28145b501c3d3b462be3b590566e964a /unix/tclLoadDl.c
parent1f5f6de21bf647360a9f73bfb4dfce60c25c6312 (diff)
parent5117e836e0f5cc70648d831ac6dead709a56dbcb (diff)
downloadtcl-b9f74bb43e5903dbe3fadd8c4d382c1724ee883f.zip
tcl-b9f74bb43e5903dbe3fadd8c4d382c1724ee883f.tar.gz
tcl-b9f74bb43e5903dbe3fadd8c4d382c1724ee883f.tar.bz2
[Bug #3216070] Loading extension libraries from embedded Tcl applications.
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r--unix/tclLoadDl.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index e9ff134..e38c280 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -19,17 +19,17 @@
/*
* In some systems, like SunOS 4.1.3, the RTLD_NOW flag isn't defined and this
- * argument to dlopen must always be 1. The RTLD_GLOBAL flag is needed on some
- * systems (e.g. SCO and UnixWare) but doesn't exist on others; if it doesn't
- * exist, set it to 0 so it has no effect.
+ * argument to dlopen must always be 1. The RTLD_LOCAL flag doesn't exist on
+ * some platforms; if it doesn't exist, set it to 0 so it has no effect.
+ * See [Bug #3216070]
*/
#ifndef RTLD_NOW
# define RTLD_NOW 1
#endif
-#ifndef RTLD_GLOBAL
-# define RTLD_GLOBAL 0
+#ifndef RTLD_LOCAL
+# define RTLD_LOCAL 0
#endif
/*
@@ -73,7 +73,10 @@ TclpDlopen(
*/
native = Tcl_FSGetNativePath(pathPtr);
- handle = dlopen(native, RTLD_NOW | RTLD_GLOBAL);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ handle = dlopen(native, RTLD_NOW | RTLD_LOCAL);
if (handle == NULL) {
/*
* Let the OS loader examine the binary search path for whatever
@@ -85,7 +88,10 @@ TclpDlopen(
char *fileName = Tcl_GetString(pathPtr);
native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
- handle = dlopen(native, RTLD_NOW | RTLD_GLOBAL);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ handle = dlopen(native, RTLD_NOW | RTLD_LOCAL);
Tcl_DStringFree(&ds);
}