about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-07-09 12:38:48 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-07-09 12:38:48 +0200
commitdabbca767f9de4fc4cf68252037de3061592eae2 (patch)
treebfc1dadad814a82a155c0c374097177b94154beb /src/include
parentca9bc1361943575724eb5152798aa208ed5eed6c (diff)
downloadbox64-dabbca767f9de4fc4cf68252037de3061592eae2.tar.gz
box64-dabbca767f9de4fc4cf68252037de3061592eae2.zip
[ELFLOADER] Added a check if lib version is compatible with what the elf loading it wants (helps Linux games on Steam)
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/elfloader.h3
-rwxr-xr-xsrc/include/librarian.h2
-rwxr-xr-xsrc/include/library.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/include/elfloader.h b/src/include/elfloader.h
index d5b54145..ca8839df 100755
--- a/src/include/elfloader.h
+++ b/src/include/elfloader.h
@@ -25,6 +25,7 @@ int CalcLoadAddr(elfheader_t* head);
 int AllocElfMemory(box64context_t* context, elfheader_t* head, int mainbin);
 void FreeElfMemory(elfheader_t* head);
 int LoadElfMemory(FILE* f, box64context_t* context, elfheader_t* head);
+int isElfHasNeededVer(elfheader_t* head, const char* libname, elfheader_t* verneeded);
 int ReloadElfMemory(FILE* f, box64context_t* context, elfheader_t* head);
 int RelocateElf(lib_t *maplib, lib_t* local_maplib, int bindnow, elfheader_t* head);
 int RelocateElfPlt(lib_t *maplib, lib_t* local_maplib, int bindnow, elfheader_t* head);
@@ -64,6 +65,8 @@ const char* GetParentSymbolVersion(elfheader_t* h, int index);
 const char* VersionedName(const char* name, int ver, const char* vername);
 int SameVersionedSymbol(const char* name1, int ver1, const char* vername1, const char* name2, int ver2, const char* vername2);
 int GetVersionIndice(elfheader_t* h, const char* vername);
+int GetNeededVersionCnt(elfheader_t* h, const char* libname);
+const char* GetNeededVersionString(elfheader_t* h, const char* libname, int idx);
 
 kh_mapsymbols_t* GetMapSymbols(elfheader_t* h);
 kh_mapsymbols_t* GetWeakSymbols(elfheader_t* h);
diff --git a/src/include/librarian.h b/src/include/librarian.h
index c05ce963..80e108ca 100755
--- a/src/include/librarian.h
+++ b/src/include/librarian.h
@@ -21,7 +21,7 @@ void FreeDLPrivate(dlprivate_t **lib);
 
 box64context_t* GetLibrarianContext(lib_t* maplib);
 kh_mapsymbols_t* GetGlobalData(lib_t* maplib);
-int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, box64context_t* box64, x64emu_t* emu); // 0=success, 1=error
+int AddNeededLib(lib_t* maplib, int local, int bindnow, needed_libs_t* needed, elfheader_t* verneeded, box64context_t* box64, x64emu_t* emu); // 0=success, 1=error
 void RemoveNeededLib(lib_t* maplib, int local, needed_libs_t* needed, box64context_t* box64, x64emu_t* emu);
 library_t* GetLibMapLib(lib_t* maplib, const char* name);
 library_t* GetLibInternal(const char* name);
diff --git a/src/include/library.h b/src/include/library.h
index ff48b691..b08927e0 100755
--- a/src/include/library.h
+++ b/src/include/library.h
@@ -15,7 +15,7 @@ typedef struct elfheader_s     elfheader_t;
 #define LIB_EMULATED    1
 #define LIB_UNNKNOW     -1
 
-library_t *NewLibrary(const char* path, box64context_t* box64);
+library_t *NewLibrary(const char* path, box64context_t* box64, elfheader_t* verneeded);
 int AddSymbolsLibrary(lib_t* maplib, library_t* lib, x64emu_t* emu);
 int FinalizeLibrary(library_t* lib, lib_t* local_maplib, int bindnow, x64emu_t* emu);