diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-10-31 15:38:31 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-10-31 15:38:31 +0100 |
| commit | 362a3fde10a3bb2738fcf30ae2e2eaf4a53df042 (patch) | |
| tree | ff6233f6cba44c0326cbe366d79fb7a46e1b8d60 /src/include | |
| parent | 5c13f8f10ac82ca642a6c930585989cc0d75a664 (diff) | |
| download | box64-362a3fde10a3bb2738fcf30ae2e2eaf4a53df042.tar.gz box64-362a3fde10a3bb2738fcf30ae2e2eaf4a53df042.zip | |
[ELFLOADER] Changed how memory is managed in elfloader
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/custommem.h | 1 | ||||
| -rw-r--r-- | src/include/elfloader.h | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/include/custommem.h b/src/include/custommem.h index 31b3f30e..ffd20af6 100644 --- a/src/include/custommem.h +++ b/src/include/custommem.h @@ -96,6 +96,7 @@ void* find32bitBlock(size_t size); void* find31bitBlockNearHint(void* hint, size_t size); void* find47bitBlock(size_t size); void* find47bitBlockNearHint(void* hint, size_t size); +void* find47bitBlockElf(size_t size, int mainbin); int isBlockFree(void* hint, size_t size); // unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex diff --git a/src/include/elfloader.h b/src/include/elfloader.h index d9d7f152..bc09ad31 100644 --- a/src/include/elfloader.h +++ b/src/include/elfloader.h @@ -14,6 +14,7 @@ typedef struct kh_defaultversion_s kh_defaultversion_t; typedef struct dynablock_s dynablock_t; #endif +// Open an elfheader. Transfert control of f to elfheader also! elfheader_t* LoadAndCheckElfHeader(FILE* f, const char* name, int exec); // exec : 0 = lib, 1 = exec void FreeElfHeader(elfheader_t** head); const char* ElfName(elfheader_t* head); @@ -22,11 +23,9 @@ void ElfAttachLib(elfheader_t* head, library_t* lib); // return 0 if OK int CalcLoadAddr(elfheader_t* head); -int AllocElfMemory(box64context_t* context, elfheader_t* head, int mainbin); +int AllocLoadElfMemory(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); void CalcStack(elfheader_t* h, uint64_t* stacksz, size_t* stackalign); |