From 70018a774bf7411ef7550aa4fb3eb153d17dcfd6 Mon Sep 17 00:00:00 2001 From: rajdakin Date: Fri, 9 Apr 2021 17:52:59 +0200 Subject: Fixed the libraries free ordering --- src/include/box64context.h | 2 ++ src/include/elfloader.h | 4 ++-- src/include/librarian.h | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/box64context.h b/src/include/box64context.h index 709f9cbf..ffcacc36 100755 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -50,6 +50,8 @@ typedef struct needed_libs_s { void add_neededlib(needed_libs_t* needed, library_t* lib); void free_neededlib(needed_libs_t* needed); +void add_dependedlib(needed_libs_t* depended, library_t* lib); +void free_dependedlib(needed_libs_t* depended); typedef struct base_segment_s { uintptr_t base; diff --git a/src/include/elfloader.h b/src/include/elfloader.h index 241c25e7..a46d9b05 100755 --- a/src/include/elfloader.h +++ b/src/include/elfloader.h @@ -30,7 +30,7 @@ void CalcStack(elfheader_t* h, uint32_t* stacksz, int* stackalign); uintptr_t GetEntryPoint(lib_t* maplib, elfheader_t* h); uintptr_t GetLastByte(elfheader_t* h); void AddSymbols(lib_t *maplib, kh_mapsymbols_t* mapsymbols, kh_mapsymbols_t* weaksymbols, kh_mapsymbols_t* localsymbols, elfheader_t* h); -int LoadNeededLibs(elfheader_t* h, lib_t *maplib, needed_libs_t* neededlibs, int local, box64context_t *box86, x64emu_t* emu); +int LoadNeededLibs(elfheader_t* h, lib_t *maplib, needed_libs_t* neededlibs, library_t *deplib, int local, box64context_t *box64, x64emu_t* emu); uintptr_t GetElfInit(elfheader_t* h); uintptr_t GetElfFini(elfheader_t* h); void RunElfInit(elfheader_t* h, x64emu_t *emu); @@ -56,4 +56,4 @@ void CreateMemorymapFile(box64context_t* context, int fd); int ElfCheckIfUseTCMallocMinimal(elfheader_t* h); // return 1 if tcmalloc is used -#endif //__ELF_LOADER_H_ \ No newline at end of file +#endif //__ELF_LOADER_H_ diff --git a/src/include/librarian.h b/src/include/librarian.h index f63b500f..6e69349b 100755 --- a/src/include/librarian.h +++ b/src/include/librarian.h @@ -24,7 +24,7 @@ kh_mapsymbols_t* GetMapSymbol(lib_t* maplib); kh_mapsymbols_t* GetWeakSymbol(lib_t* maplib); kh_mapsymbols_t* GetLocalSymbol(lib_t* maplib); kh_mapsymbols_t* GetGlobalData(lib_t* maplib); -int AddNeededLib(lib_t* maplib, needed_libs_t* neededlibs, int local, const char* path, box64context_t* box86, x64emu_t* emu); // 0=success, 1=error +int AddNeededLib(lib_t* maplib, needed_libs_t* neededlibs, library_t *deplib, int local, const char* path, box64context_t* box64, x64emu_t* emu); // 0=success, 1=error library_t* GetLibMapLib(lib_t* maplib, const char* name); library_t* GetLibInternal(const char* name); uintptr_t FindGlobalSymbol(lib_t *maplib, const char* name); @@ -48,4 +48,4 @@ const char* FindSymbolName(lib_t *maplib, void* p, void** start, uint32_t* sz, c void AddOffsetSymbol(lib_t *maplib, void* offs, const char* name); const char* GetNameOffset(lib_t *maplib, void* offs); -#endif //__LIBRARIAN_H_ \ No newline at end of file +#endif //__LIBRARIAN_H_ -- cgit 1.4.1