diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-11-13 12:53:09 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-11-13 12:53:09 +0100 |
| commit | e071406829e5301aab5f53c4a9084aca302bb976 (patch) | |
| tree | 3d16cb36061f89e856069ea537eae635258efb67 /src/elfs | |
| parent | 590429d10456b346f56114563caac39dfb43c485 (diff) | |
| download | box64-e071406829e5301aab5f53c4a9084aca302bb976.tar.gz box64-e071406829e5301aab5f53c4a9084aca302bb976.zip | |
[ELFLOADER] Small changes on elf memory managment
Diffstat (limited to 'src/elfs')
| -rw-r--r-- | src/elfs/elfloader.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c index c1e5dbdb..80533f96 100644 --- a/src/elfs/elfloader.c +++ b/src/elfs/elfloader.c @@ -223,9 +223,9 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) head->image = image; #if defined(PAGE8K) || defined(PAGE16K) || defined(PAGE64K) - setProtection((uintptr_t)image, head->memsz, PROT_READ|PROT_WRITE|PROT_EXEC); + setProtection_elf((uintptr_t)image, head->memsz, PROT_READ|PROT_WRITE|PROT_EXEC); #else - setProtection((uintptr_t)image, head->memsz, 0); + setProtection_elf((uintptr_t)image, head->memsz, 0); #endif head->multiblocks = (multiblock_t*)box_calloc(head->multiblock_n, sizeof(multiblock_t)); @@ -280,7 +280,7 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) try_mmap = 0; printf_log(log_level, "Mapping failed, using regular mmap+read"); } else { - setProtection((uintptr_t)p, head->multiblocks[n].asize, prot); + setProtection_elf((uintptr_t)p, head->multiblocks[n].asize, prot); head->multiblocks[n].p = p; } @@ -306,7 +306,7 @@ int AllocLoadElfMemory(box64context_t* context, elfheader_t* head, int mainbin) } return 1; } - setProtection((uintptr_t)p, asize, prot); + setProtection_elf((uintptr_t)p, asize, prot); head->multiblocks[n].p = p; if(e->p_filesz) { fseeko64(head->file, head->multiblocks[n].offs, SEEK_SET); |