diff options
Diffstat (limited to 'src/kernel/user/elf.c')
-rw-r--r-- | src/kernel/user/elf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/kernel/user/elf.c b/src/kernel/user/elf.c index a3dada7..ed9d3c4 100644 --- a/src/kernel/user/elf.c +++ b/src/kernel/user/elf.c @@ -42,9 +42,7 @@ proc_entry_t elf_load(fs_handle_t *f, process_t* process) { size_t read_r = file_read(f, phdr.p_offset, phdr.p_filesz, (char*)phdr.p_vaddr); if (read_r != phdr.p_filesz) goto error; - if (phdr.p_memsz > phdr.p_filesz) { - memset((char*)phdr.p_vaddr + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz); - } + // no need to zero out extra portion, paging code does that for us if (!(phdr.p_flags & PF_W)) { bool mchmap_ok = mchmap(process, (void*)phdr.p_vaddr, |