about summary refs log tree commit diff stats
path: root/src/core.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-10-15 20:52:16 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-10-15 20:52:16 +0200
commitd0045b158b30434c2077693d970e2167a1089e84 (patch)
treeb2951427e4870055cf79f6388d9755a227e843f7 /src/core.c
parent1d4a9e8863d7e32f0bb1472674a94f05df1409b5 (diff)
downloadbox64-d0045b158b30434c2077693d970e2167a1089e84.tar.gz
box64-d0045b158b30434c2077693d970e2167a1089e84.zip
Some Segments/Selector handling refactoring , removing some pthread_getspecific use
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 20a6df56..14d0c26a 100644
--- a/src/core.c
+++ b/src/core.c
@@ -67,6 +67,7 @@ int box64_zoom = 0;
 int box64_steam = 0;
 int box64_steamcmd = 0;
 int box64_musl = 0;
+int box64_nolibs = 0;
 char* box64_custom_gstreamer = NULL;
 int box64_tcmalloc_minimal = 0;
 uintptr_t fmod_smc_start = 0;
@@ -1322,6 +1323,8 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
         my_context->orig_argc = argc;
         my_context->orig_argv = (char**)argv;
     }
+    box64_nolibs = (NeededLibs(elf_header)==0);
+    if(box64_nolibs) printf_log(LOG_INFO, "Warning, box64 is not really compatible with staticaly linked binaries. Expect crash!\n");
     box64_isglibc234 = GetNeededVersionForLib(elf_header, "libc.so.6", "GLIBC_2.34");
     if(box64_isglibc234)
         printf_log(LOG_DEBUG, "Program linked with GLIBC 2.34+\n");
@@ -1405,7 +1408,7 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
     setupTraceInit();
     RunDeferredElfInit(emu);
     // update TLS of main elf
-    RefreshElfTLS(elf_header);
+    RefreshElfTLS(elf_header, emu);
     // do some special case check, _IO_2_1_stderr_ and friends, that are setup by libc, but it's already done here, so need to do a copy
     ResetSpecialCaseMainElf(elf_header);
     // init...