From 58cdb1bda2f2dd6a0bc5ea42e99b279fc687c06b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 22 Oct 2022 20:57:31 +0200 Subject: Refactored, again, elfloader symbol fetching (ported from box86) --- src/include/library.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/include/library.h') diff --git a/src/include/library.h b/src/include/library.h index 1bd9be3a..b62e122d 100755 --- a/src/include/library.h +++ b/src/include/library.h @@ -9,8 +9,9 @@ typedef struct kh_symbolmap_s kh_symbolmap_t; typedef struct box64context_s box64context_t; typedef struct x64emu_s x64emu_t; typedef struct needed_libs_s needed_libs_t; +typedef struct elfheader_s elfheader_t; -#define LIB_NATIVE 0 +#define LIB_WRAPPED 0 #define LIB_EMULATED 1 #define LIB_UNNKNOW -1 @@ -23,9 +24,9 @@ void Free1Library(library_t **lib, x64emu_t* emu); char* GetNameLib(library_t *lib); int IsSameLib(library_t* lib, const char* path); // check if lib is same (path -> name) -int GetLibSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, int local); -int GetLibNoWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, int local); -int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, int version, const char* vername, int local); +int GetLibGlobalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, int* weak, int version, const char* vername, int local); +int GetLibWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, int* weak, int version, const char* vername, int local); +int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end, int* weak, int version, const char* vername, int local); void fillGLProcWrapper(box64context_t* context); void freeGLProcWrapper(box64context_t* context); void fillALProcWrapper(box64context_t* context); @@ -35,7 +36,8 @@ int GetNeededLibN(library_t* lib); library_t* GetNeededLib(library_t* lib, int idx); lib_t* GetMaplib(library_t* lib); -int GetElfIndex(library_t* lib); // -1 if no elf (i.e. native) -void* GetHandle(library_t* lib); // NULL if not native +int GetElfIndex(library_t* lib); // -1 if no elf (i.e. wrapped) +elfheader_t* GetElf(library_t* lib); // NULL if no elf (i.e. wrapped) +void* GetHandle(library_t* lib); // NULL if not wrapped #endif //__LIBRARY_H_ -- cgit 1.4.1