about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorYang Liu <numbksco@gmail.com>2024-11-05 20:10:10 +0800
committerGitHub <noreply@github.com>2024-11-05 13:10:10 +0100
commita51f684c413d15b8f6d2f68583512c43901a2c9b (patch)
tree8b43d30d1bf711a1a56dec51c96009dd16bb4e74 /src
parent681e207af574d07bec8d3976a1c3d6382540fbeb (diff)
downloadbox64-a51f684c413d15b8f6d2f68583512c43901a2c9b.tar.gz
box64-a51f684c413d15b8f6d2f68583512c43901a2c9b.zip
[WRAPPER] Wrapped 3 more symbols for libc (#2000)
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt3
-rw-r--r--src/wrapped/generated/wrappedlibctypes.h3
-rw-r--r--src/wrapped/wrappedlibc.c16
-rw-r--r--src/wrapped/wrappedlibc_private.h6
4 files changed, 17 insertions, 11 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index c0d1c01e..80429074 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -4311,6 +4311,7 @@ wrappedlibc:
 - iFi:
   - iopl
 - iFp:
+  - __libc_dlclose
   - _setjmp
   - atexit
   - getcontext
@@ -4395,8 +4396,10 @@ wrappedlibc:
   - sigset
   - sysv_signal
 - pFpi:
+  - __libc_dlopen_mode
   - backtrace_symbols
 - pFpp:
+  - __libc_dlsym
   - __realpath_chk
   - realpath
 - SFpp:
diff --git a/src/wrapped/generated/wrappedlibctypes.h b/src/wrapped/generated/wrappedlibctypes.h
index d6049eb6..206d429f 100644
--- a/src/wrapped/generated/wrappedlibctypes.h
+++ b/src/wrapped/generated/wrappedlibctypes.h
@@ -114,6 +114,7 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
 	GO(fork, iFv_t) \
 	GO(vfork, iFv_t) \
 	GO(iopl, iFi_t) \
+	GO(__libc_dlclose, iFp_t) \
 	GO(_setjmp, iFp_t) \
 	GO(atexit, iFp_t) \
 	GO(getcontext, iFp_t) \
@@ -179,7 +180,9 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
 	GO(signal, pFip_t) \
 	GO(sigset, pFip_t) \
 	GO(sysv_signal, pFip_t) \
+	GO(__libc_dlopen_mode, pFpi_t) \
 	GO(backtrace_symbols, pFpi_t) \
+	GO(__libc_dlsym, pFpp_t) \
 	GO(__realpath_chk, pFpp_t) \
 	GO(realpath, pFpp_t) \
 	GO(fopen, SFpp_t) \
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 22187f95..01b5bc69 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -3250,6 +3250,14 @@ EXPORT int my___libc_alloca_cutoff(x64emu_t* emu, size_t size)
     return (size<=(65536*4));
 }
 
+EXPORT int my_nanosleep(const struct timespec *req, struct timespec *rem)
+{
+    if(!req)
+        return 0;   // workaround for some strange calls
+    return nanosleep(req, rem);
+}
+#endif
+
 // DL functions from wrappedlibdl.c
 void* my_dlopen(x64emu_t* emu, void *filename, int flag);
 int my_dlclose(x64emu_t* emu, void *handle);
@@ -3267,14 +3275,6 @@ EXPORT void* my___libc_dlsym(x64emu_t* emu, void* handle, void* name)
     return my_dlsym(emu, handle, name);
 }
 
-EXPORT int my_nanosleep(const struct timespec *req, struct timespec *rem)
-{
-    if(!req)
-        return 0;   // workaround for some strange calls
-    return nanosleep(req, rem);
-}
-#endif
-
 #ifdef ANDROID
 void obstackSetup() {
 }
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index 1251e171..ce9f3976 100644
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -1159,9 +1159,9 @@ GO(__libc_current_sigrtmax, iFv)
 //GO(__libc_current_sigrtmax_private, 
 GO(__libc_current_sigrtmin, iFv)
 //GO(__libc_current_sigrtmin_private, 
-//GO(__libc_dlclose, 
-//GO(__libc_dlopen_mode, 
-//GO(__libc_dlsym, 
+GOM(__libc_dlclose, iFEp)
+GOM(__libc_dlopen_mode, pFEpi)
+GOM(__libc_dlsym, pFEpp)
 //GO(__libc_dlvsym, 
 //GO(__libc_dynarray_at_failure, 
 //GO(__libc_dynarray_emplace_enlarge,