Skip to content

Commit e6660a6

Browse files
committed
Switch to compiler globals
1 parent 8292577 commit e6660a6

File tree

6 files changed

+4
-4
lines changed

6 files changed

+4
-4
lines changed

Zend/zend_extensions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "zend_extensions.h"
2121
#include "zend_system_id.h"
22-
#include "SAPI.h"
2322

2423
ZEND_API zend_llist zend_extensions;
2524
ZEND_API uint32_t zend_extension_flags = 0;

Zend/zend_globals.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ struct _zend_compiler_globals {
161161
#ifdef ZTS
162162
uint32_t copied_functions_count;
163163
#endif
164+
165+
bool isolate_symbols;
164166
};
165167

166168

Zend/zend_portability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
167167
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer)
168168
# if defined(LM_ID_NEWLM)
169-
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | ((sapi_module.flags & SAPI_MODULE_FLAG_ISOLATE_SYMBOLS) != 0 ? RTLD_DEEPBIND : 0))
169+
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | (CG(isolate_symbols) ? RTLD_DEEPBIND : 0))
170170
# else
171171
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)
172172
# endif

main/SAPI.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ SAPI_API void sapi_startup(sapi_module_struct *sf)
6969
{
7070
sf->ini_entries = NULL;
7171
sapi_module = *sf;
72+
CG(isolate_symbols) = (sf->flags & SAPI_MODULE_FLAG_ISOLATE_SYMBOLS) != 0;
7273

7374
#ifdef ZTS
7475
ts_allocate_fast_id(&sapi_globals_id, &sapi_globals_offset, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor);

sapi/litespeed/lsapilib.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9393
#endif
9494

9595
#include <Zend/zend_portability.h>
96-
#include "main/SAPI.h"
9796

9897
struct lsapi_MD5Context {
9998
uint32 buf[4];

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <stdio.h>
2020
#include <string.h>
2121
#include "zend.h"
22-
#include "main/SAPI.h"
2322
#include "zend_compile.h"
2423
#include "zend_exceptions.h"
2524
#include "zend_vm.h"

0 commit comments

Comments
 (0)