mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
elf: lazy allocate some parts of the executables
This commit is contained in:
@@ -125,12 +125,8 @@ static int load(vnode_t *vnode, elfph64_t *ph) {
|
||||
|
||||
// zero some parts if needed
|
||||
if (msize) {
|
||||
if (vmm_map((void *)mempos, msize, VMM_FLAGS_EXACT | VMM_FLAGS_ALLOCATE, mmuflags | ARCH_MMU_FLAGS_WRITE, NULL) == NULL)
|
||||
if (vmm_map((void *)mempos, msize, VMM_FLAGS_EXACT, mmuflags, NULL) == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
memset((void *)mempos, 0, ROUND_UP(msize, PAGE_SIZE));
|
||||
|
||||
// TODO switch out protection
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user