about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorptitSeb <seebastien.chev@gmail.com>2023-08-26 17:08:27 +0200
committerptitSeb <seebastien.chev@gmail.com>2023-08-26 17:08:27 +0200
commitaa051b662e3a0e8c80e7b6373d35e22da3c42d79 (patch)
treec8a5ce1db387794f304d618fc9b1801661319ca6 /src/main.c
parent5fabd602aea1937e3c5ce58843504c2492b8c0ec (diff)
downloadbox64-aa051b662e3a0e8c80e7b6373d35e22da3c42d79.tar.gz
box64-aa051b662e3a0e8c80e7b6373d35e22da3c42d79.zip
Fixed detection and loading of program linked with glibc 2.34+
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 14e04d11..e8ebe74d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1701,6 +1701,9 @@ int main(int argc, const char **argv, char **env) {
         for(int i=nextarg; i<argc; ++i)
             argv[i] -= diff;    // adjust strings
     }
+    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");
     // get and alloc stack size and align
     if(CalcStackSize(my_context)) {
         printf_log(LOG_NONE, "Error: allocating stack\n");
@@ -1726,9 +1729,6 @@ int main(int argc, const char **argv, char **env) {
 
     // export symbols
     AddSymbols(my_context->maplib, GetMapSymbols(elf_header), GetWeakSymbols(elf_header), GetLocalSymbols(elf_header), elf_header);
-    box64_isglibc234 = GetVersionIndice(elf_header, "GLIBC_2.34")?1:0;
-    if(box64_isglibc234)
-        printf_log(LOG_DEBUG, "Program linked with GLIBC 2.34+\n");
     if(wine_preloaded) {
         uintptr_t wineinfo = FindSymbol(GetMapSymbols(elf_header), "wine_main_preload_info", -1, NULL, 1, NULL);
         if(!wineinfo) wineinfo = FindSymbol(GetWeakSymbols(elf_header), "wine_main_preload_info", -1, NULL, 1, NULL);