[DYNACACHE] Allow Dynacache to be serialized when _exit is used

This commit is contained in:
ptitSeb
2025-10-12 14:52:49 +02:00
parent af437fa354
commit 7b66c024f0
4 changed files with 16 additions and 2 deletions

View File

@@ -4875,6 +4875,7 @@ wrappedlibc:
- __cxa_pure_virtual
- __stack_chk_fail
- vFi:
- _exit
- exit
- vFp:
- _ITM_deregisterTMCloneTable

View File

@@ -118,6 +118,7 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
GO(_Jv_RegisterClasses, vFv_t) \
GO(__cxa_pure_virtual, vFv_t) \
GO(__stack_chk_fail, vFv_t) \
GO(_exit, vFi_t) \
GO(exit, vFi_t) \
GO(_ITM_deregisterTMCloneTable, vFp_t) \
GO(_ZGTtdlPv, vFp_t) \

View File

@@ -3877,7 +3877,19 @@ EXPORT void my_exit(x64emu_t* emu, int code)
exit(code);
}
EXPORT void my__exit(x64emu_t* emu, int code) __attribute__((alias("my_exit")));
EXPORT void my__exit(x64emu_t* emu, int code)
{
if(emu->flags.quitonexit || emu->quit) {
_exit(code);
}
printf_log(LOG_INFO, "Fast _exit called\n");
emu->quit = 1;
box64_exit_code = code;
SerializeAllMapping(); // just to be safe
// then call all the fini
_exit(code);
}
EXPORT int my_prctl(x64emu_t* emu, int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5)
{

View File

@@ -352,7 +352,7 @@ GOM(execv, iFEpp)
GOM(execve, iFEppp)
GOM(execvp, iFEpp)
GOWM(execvpe, iFEppp)
GO(_exit, vFi)
GOM(_exit, vFEi)
GOM(exit, vFEi)
GOW(_Exit, vFi)
GO(explicit_bzero, vFpL)