about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-04 08:27:30 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-04 08:27:30 +0100
commitb34a91959037c6e3b50d3c2cfd9f69385cc0a729 (patch)
tree5312e6bf20de8f6c358ac6f9094552fdbe52e023 /src
parent9bc6cd4ed13ee90c2fa4dfe055c9a25deefd20e0 (diff)
downloadbox64-b34a91959037c6e3b50d3c2cfd9f69385cc0a729.tar.gz
box64-b34a91959037c6e3b50d3c2cfd9f69385cc0a729.zip
Small change to wrapped ld-linux to make it more portable
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wrapped/wrappedldlinux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wrapped/wrappedldlinux.c b/src/wrapped/wrappedldlinux.c
index 56b581a0..002a426f 100755
--- a/src/wrapped/wrappedldlinux.c
+++ b/src/wrapped/wrappedldlinux.c
@@ -33,10 +33,15 @@ EXPORT void* my____tls_get_addr(x64emu_t* emu)
     return GetDTatOffset(emu->context, t->i, t->o);
 }
 
-
-const char* ldlinuxName = "ld-linux-x86-64.so.2";
+// don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux
+const char* ldlinuxName = "ld-linux.so.2";
 #define LIBNAME ldlinux
 
+#define PRE_INIT\
+    if(1)                                                           \
+        lib->priv.w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL);    \
+    else
+
 // define all standard library functions
 #include "wrappedlib_init.h"