diff options
| author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2011-03-22 10:14:00 (GMT) |
|---|---|---|
| committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2011-03-22 10:14:00 (GMT) |
| commit | 832d312f5ec75cd3edc4d5650d5a3a43d1e25887 (patch) | |
| tree | bd799accde5a0badd4053c8b583bc496ce792682 /unix/tclLoadDl.c | |
| parent | 462dec66b4761638fc121a86af45bcc35d6a4b23 (diff) | |
| parent | 2c2f5655e138a09128eec384ebae2ba1c2a9ee29 (diff) | |
| download | tcl-832d312f5ec75cd3edc4d5650d5a3a43d1e25887.zip tcl-832d312f5ec75cd3edc4d5650d5a3a43d1e25887.tar.gz tcl-832d312f5ec75cd3edc4d5650d5a3a43d1e25887.tar.bz2 | |
[Bug #3216070] Loading extension libraries from embedded Tcl applications.
Diffstat (limited to 'unix/tclLoadDl.c')
| -rw-r--r-- | unix/tclLoadDl.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index aeb06ef..96f0717 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 /* @@ -82,7 +82,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 @@ -94,7 +97,10 @@ TclpDlopen( const 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); } |
