diff options
| author | ptitSeb <seebastien.chev@gmail.com> | 2023-08-26 17:08:27 +0200 |
|---|---|---|
| committer | ptitSeb <seebastien.chev@gmail.com> | 2023-08-26 17:08:27 +0200 |
| commit | aa051b662e3a0e8c80e7b6373d35e22da3c42d79 (patch) | |
| tree | c8a5ce1db387794f304d618fc9b1801661319ca6 /src/elfs/elfparser.c | |
| parent | 5fabd602aea1937e3c5ce58843504c2492b8c0ec (diff) | |
| download | box64-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.c | 17 |
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; +} |