Skip to content

Commit cc5025c

Browse files
committed
Remove DLSYM_NEEDS_UNDERSCORE
Some non-ELF platforms in the past (BSD-based systems - OpenBSD, NetBSD, FreeBSD and Mac OS X ~10.3) required dlsym() to have symbol names prefixed with an underscore (_) character. This isn't relevant anymore on current systems.
1 parent 13b83a4 commit cc5025c

3 files changed

Lines changed: 3 additions & 20 deletions

File tree

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES
9999
. --with-pic is now --enable-pic. The old flag will result in an error.
100100
. Symbol HAVE_ST_BLOCKS has been removed from php_config.h (use
101101
HAVE_STRUCT_STAT_ST_BLOCKS).
102+
. Symbol DLSYM_NEEDS_UNDERSCORE for using dlsym() with an underscore prefix
103+
in symbol names has been removed (obsolete on current systems).
102104

103105
- Windows build system changes:
104106
. Function SETUP_OPENSSL() doesn't accept 6th argument anymore and doesn't

Zend/Zend.m4

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,6 @@ AS_VAR_IF([php_cv_have_fpu_inline_asm_x86], [yes],
111111
[Define to 1 if FPU control word can be manipulated by inline assembler.])])
112112
])
113113

114-
dnl
115-
dnl ZEND_DLSYM_CHECK
116-
dnl
117-
dnl Ugly hack to check if dlsym() requires a leading underscore in symbol name.
118-
dnl
119-
AC_DEFUN([ZEND_DLSYM_CHECK], [dnl
120-
AC_MSG_CHECKING([whether dlsym() requires a leading underscore in symbol names])
121-
_LT_TRY_DLOPEN_SELF([AC_MSG_RESULT([no])], [
122-
AC_MSG_RESULT([yes])
123-
AC_DEFINE([DLSYM_NEEDS_UNDERSCORE], [1],
124-
[Define to 1 if 'dlsym()' requires a leading underscore in symbol names.])
125-
], [AC_MSG_RESULT([no])], [])
126-
])
127-
128114
dnl
129115
dnl ZEND_INIT
130116
dnl
@@ -168,7 +154,6 @@ AC_CHECK_FUNC([sigsetjmp],,
168154
169155
ZEND_CHECK_STACK_DIRECTION
170156
ZEND_CHECK_FLOAT_PRECISION
171-
ZEND_DLSYM_CHECK
172157
ZEND_CHECK_GLOBAL_REGISTER_VARIABLES
173158
ZEND_CHECK_PRESERVE_NONE
174159
ZEND_CHECK_CPUID_COUNT

Zend/zend_portability.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,7 @@
194194
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL)
195195
# endif
196196
# define DL_UNLOAD dlclose
197-
# if defined(DLSYM_NEEDS_UNDERSCORE)
198-
# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" s)
199-
# else
200-
# define DL_FETCH_SYMBOL dlsym
201-
# endif
197+
# define DL_FETCH_SYMBOL dlsym
202198
# define DL_ERROR dlerror
203199
# define DL_HANDLE void *
204200
# define ZEND_EXTENSIONS_SUPPORT 1

0 commit comments

Comments
 (0)