Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b07787

Browse files
committed
Remove use of RTLD_GLOBAL.
1 parent c85be6a commit 6b07787

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

Python/importdl.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,6 @@ typedef void (*dl_funcptr)();
182182
#ifndef RTLD_LAZY
183183
#define RTLD_LAZY 1
184184
#endif
185-
#ifndef RTLD_GLOBAL
186-
#define RTLD_GLOBAL 0
187-
#endif
188185
#define SHORT_EXT ".so"
189186
#define LONG_EXT "module.so"
190187
#endif /* USE_SHLIB */
@@ -376,13 +373,13 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
376373
#ifdef RTLD_NOW
377374
/* RTLD_NOW: resolve externals now
378375
(i.e. core dump now if some are missing) */
379-
void *handle = dlopen(pathname, RTLD_NOW | RTLD_GLOBAL);
376+
void *handle = dlopen(pathname, RTLD_NOW);
380377
#else
381378
void *handle;
382379
if (Py_VerboseFlag)
383380
printf("dlopen(\"%s\", %d);\n", pathname,
384-
RTLD_LAZY | RTLD_GLOBAL);
385-
handle = dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);
381+
RTLD_LAZY);
382+
handle = dlopen(pathname, RTLD_LAZY);
386383
#endif /* RTLD_NOW */
387384
if (handle == NULL) {
388385
PyErr_SetString(PyExc_ImportError, dlerror());
@@ -562,6 +559,7 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
562559
printf("shl_load %s\n",pathname);
563560
}
564561
lib = shl_load(pathname, flags, 0);
562+
/* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
565563
if (lib == NULL)
566564
{
567565
char buf[256];

0 commit comments

Comments
 (0)