diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-04-09 15:19:45 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-04-09 15:19:45 +0200 |
| commit | 8c991cb6762d3a1384cec16d6e54402ce276ea9e (patch) | |
| tree | 3d109e77532ce32822efec69950b7db787368fcc /src/wrapped/wrappedlibc.c | |
| parent | 70770db8bec892e66fa8b6834f1ea4a8f27325b6 (diff) | |
| download | box64-8c991cb6762d3a1384cec16d6e54402ce276ea9e.tar.gz box64-8c991cb6762d3a1384cec16d6e54402ce276ea9e.zip | |
[DYNAREC] Better handling of self-loop and added CALLRET=2 settings (ARM64 only, RV64 and LA64 todo)
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 7eb5aa9e..20ced661 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -3029,13 +3029,6 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int f } #endif if(ret!=MAP_FAILED) { - if((flags&MAP_SHARED) && (fd>0)) { - uint32_t flags = fcntl(fd, F_GETFL); - if((flags&O_ACCMODE)==O_RDWR) { - if((BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "Note: Marking the region (%p-%p prot=%x) as NEVERCLEAN because fd have O_RDWR attribute\n", ret, ret+length, prot);} - prot |= PROT_NEVERCLEAN; - } - } if(emu && !(flags&MAP_ANONYMOUS) && (fd>0)) { DetectUnityPlayer(fd); // the last_mmap will allow mmap created by wine, even those that have hole, to be fully tracked as one single mmap @@ -3044,6 +3037,13 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int f else RecordEnvMappings((uintptr_t)ret, length, fd); } + if((flags&MAP_SHARED) && (fd>0)) { + uint32_t flags = fcntl(fd, F_GETFL); + if((flags&O_ACCMODE)==O_RDWR) { + if((BOX64ENV(log)>=LOG_DEBUG || BOX64ENV(dynarec_log)>=LOG_DEBUG)) {printf_log(LOG_NONE, "Note: Marking the region (%p-%p prot=%x) as NEVERCLEAN because fd have O_RDWR attribute\n", ret, ret+length, prot);} + prot |= PROT_NEVERCLEAN; + } + } // hack to capture full size of the mmap done by wine if(emu && (fd==-1) && (flags==(MAP_PRIVATE|MAP_ANON))) { last_mmap_addr = ret; |