diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-06-16 15:19:13 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-06-16 15:19:13 +0200 |
| commit | 1712afdae988d2d840e2220ae4a3e0de54fca05b (patch) | |
| tree | 9518042c8d8f000bcbdd6819a279c810a4915372 /src | |
| parent | 8428fafd3ac1b5dd347227af3b6d7b58cb25b37a (diff) | |
| download | box64-1712afdae988d2d840e2220ae4a3e0de54fca05b.tar.gz box64-1712afdae988d2d840e2220ae4a3e0de54fca05b.zip | |
Improved emulated library loader, to not stop at first binary found even if not at the correct architecture
Diffstat (limited to 'src')
| -rwxr-xr-x | src/librarian/library.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/librarian/library.c b/src/librarian/library.c index 7ca96e0a..992f694e 100755 --- a/src/librarian/library.c +++ b/src/librarian/library.c @@ -219,18 +219,19 @@ static void initEmulatedLib(const char* path, library_t *lib, box64context_t* co { char libname[MAX_PATH]; strcpy(libname, path); - int found = FileExist(libname, IS_FILE); - if(!found && !strchr(path, '/')) + int found = FileIsX64ELF(libname); + if(found) + if(loadEmulatedLib(libname, lib, context)) + return; + if(!strchr(path, '/')) for(int i=0; i<context->box64_ld_lib.size; ++i) { strcpy(libname, context->box64_ld_lib.paths[i]); strcat(libname, path); - if(FileExist(libname, IS_FILE)) + if(FileIsX64ELF(libname)) if(loadEmulatedLib(libname, lib, context)) return; } - else - loadEmulatedLib(libname, lib, context); } extern char* libGL; |