Skip to content

Commit 601140c

Browse files
author
foobar
committed
New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The
effect of this flag when loading a "foo.so" with undefined symbols is that the search that symbol starts at foo.so and its dependencies *before* the loading process' global symbol table. This is an effective workaround for symbol namespace collisions between various modules and the libraries on which they depend (where fixing the respective modules or libraries is not possible e.g. due to API constraints). (By: Joe Orton)
1 parent 25ab28c commit 601140c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Zend/zend.h

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ const char *zend_mh_bundle_error(void);
104104

105105
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
106106
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
107+
# elif defined(RTLD_DEEPBIND)
108+
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
107109
# else
108110
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
109111
# endif

0 commit comments

Comments
 (0)