From 54101cf327b7def90636babbadbb66ce697298ee Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 18:29:53 -0400 Subject: making elf loader zero bss sections --- src/kernel/elf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kernel/elf.c') diff --git a/src/kernel/elf.c b/src/kernel/elf.c index 07cff91..8113c14 100644 --- a/src/kernel/elf.c +++ b/src/kernel/elf.c @@ -104,6 +104,8 @@ bool try_elf_run(const struct drive *d, const char *path, const char *pass_old_v continue; void *pma = pd_user_allocate(pd, entry->vma, (entry->vms - 1) / 4096 + 1, entry->flags & PH_WRITABLE); fmcpy(pma, d, h, entry->fa, entry->fs); + for (uint8_t *pma_i = pma + entry->fs; pma_i < pma + entry->vms; ++pma_i) + *pma_i = 0; } free_pages(phtable, phtable_pages); -- cgit v1.2.3