about summary refs log tree commit diff stats
path: root/src/elfs/elfparser.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/elfs/elfparser.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/elfs/elfparser.c')
-rw-r--r--src/elfs/elfparser.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/elfs/elfparser.c b/src/elfs/elfparser.c
index 1701378f..61799dae 100644
--- a/src/elfs/elfparser.c
+++ b/src/elfs/elfparser.c
@@ -466,4 +466,19 @@ const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx)
         }
     }
     return NULL;
-}
\ No newline at end of file
+}
+
+int GetNeededVersionForLib(elfheader_t* h, const char* libname, const char* ver)
+{
+    if(!libname || !ver)
+        return 0;
+    int n = GetNeededVersionCnt(h, libname);
+    if(!n)
+        return 0;
+    for(int i=0; i<n; ++i) {
+        const char* vername = GetNeededVersionString(h, libname, i);
+        if(vername && !strcmp(ver, vername))
+            return 1;
+    }
+    return 0;
+}