diff --git a/ext/opcache/jit/zend_elf.c b/ext/opcache/jit/zend_elf.c index 9e103509c0c..5327a288060 100644 --- a/ext/opcache/jit/zend_elf.c +++ b/ext/opcache/jit/zend_elf.c @@ -64,8 +64,7 @@ void zend_elf_load_symbols(void) } int fd = open(path, O_RDONLY); #elif defined(__sun) - const char *path = getexecname(); - int fd = open(path, O_RDONLY); + int fd = open("/proc/self/path/a.out", O_RDONLY); #elif defined(__HAIKU__) char path[PATH_MAX]; if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, diff --git a/ext/opcache/jit/zend_jit_perf_dump.c b/ext/opcache/jit/zend_jit_perf_dump.c index ef45efa80d0..d8f2d6130e8 100644 --- a/ext/opcache/jit/zend_jit_perf_dump.c +++ b/ext/opcache/jit/zend_jit_perf_dump.c @@ -136,8 +136,7 @@ static void zend_jit_perf_jitdump_open(void) } fd = open(path, O_RDONLY); #elif defined(__sun) - const char *path = getexecname(); - fd = open(path, O_RDONLY); + fd = open("/proc/self/path/a.out", O_RDONLY); #elif defined(__HAIKU__) char path[PATH_MAX]; if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH,