diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | unix/tclLoadDl.c | 20 | ||||
-rw-r--r-- | unix/tclLoadDyld.c | 10 |
3 files changed, 26 insertions, 9 deletions
@@ -1,3 +1,8 @@ +2011-03-21 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/tclLoadDl.c: [Bug #3216070] Loading extension libraries + * unix/tclLoadDyld.c: from embedded Tcl applications. + 2011-03-16 Jan Nijtmans <nijtmans@users.sf.net> * generic/tclCkalloc.c: [Bug #3197864] pointer truncation on Win64 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); } diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 08d651c..0a36215 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -196,7 +196,10 @@ TclpDlopen( if (tclMacOSXDarwinRelease >= 8) #endif { - dlHandle = dlopen(nativePath, RTLD_NOW | RTLD_GLOBAL); + /* + * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070] + */ + dlHandle = dlopen(nativePath, RTLD_NOW | RTLD_LOCAL); if (!dlHandle) { /* * Let the OS loader examine the binary search path for whatever @@ -206,7 +209,10 @@ TclpDlopen( fileName = Tcl_GetString(pathPtr); nativeFileName = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds); - dlHandle = dlopen(nativeFileName, RTLD_NOW | RTLD_GLOBAL); + /* + * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070] + */ + dlHandle = dlopen(nativeFileName, RTLD_NOW | RTLD_LOCAL); } if (dlHandle) { TclLoadDbgMsg("dlopen() successful"); |