summaryrefslogtreecommitdiff
path: root/Zend/zend_portability.h
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-03-11 13:38:58 +0100
committerRemi Collet <remi@php.net>2019-03-12 08:23:06 +0100
commitd633cbac1c1d957ae07994b2e20ea4d86ad8dc3c (patch)
tree7656ed6f1e556cde89a3663c16b967422695e491 /Zend/zend_portability.h
parentb003e0a0f58a690854ebb99e3205b78f22abb567 (diff)
downloadphp-git-d633cbac1c1d957ae07994b2e20ea4d86ad8dc3c.tar.gz
add --enable-rtld-now build option to change dlopen behavior
Diffstat (limited to 'Zend/zend_portability.h')
-rw-r--r--Zend/zend_portability.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index 90e6729478..18e312ed97 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -139,12 +139,18 @@
# define RTLD_GLOBAL 0
# endif
+# ifdef PHP_USE_RTLD_NOW
+# define PHP_RTLD_MODE RTLD_NOW
+# else
+# define PHP_RTLD_MODE RTLD_LAZY
+# endif
+
# 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)
+# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
+# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)
# else
-# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
+# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL)
# endif
# define DL_UNLOAD dlclose
# if defined(DLSYM_NEEDS_UNDERSCORE)