]> granicus.if.org Git - php/commitdiff
New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The
authorfoobar <sniper@php.net>
Tue, 25 Jan 2005 13:08:05 +0000 (13:08 +0000)
committerfoobar <sniper@php.net>
Tue, 25 Jan 2005 13:08:05 +0000 (13:08 +0000)
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)

Zend/zend.h

index 5c9ec20873f373b433c480b6d86b071b3faca784..0ec9fd3c14ba9d747803ada5d1e36b67f10b9818 100644 (file)
@@ -104,6 +104,8 @@ const char *zend_mh_bundle_error(void);
 
 # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
 #  define DL_LOAD(libname)                     dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
+# elif defined(RTLD_DEEPBIND)
+#  define DL_LOAD(libname)                     dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
 # else
 #  define DL_LOAD(libname)                     dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
 # endif