summaryrefslogtreecommitdiff
path: root/src/kernel/elf.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-13 18:29:53 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-13 18:29:53 -0400
commit54101cf327b7def90636babbadbb66ce697298ee (patch)
tree4723c6803e855b3a82c4020bb6f287b43a080cb4 /src/kernel/elf.c
parent5481848e27fdd4fc859def9841a0283665531a46 (diff)
downloadportland-os-54101cf327b7def90636babbadbb66ce697298ee.tar.gz
making elf loader zero bss sections
Diffstat (limited to 'src/kernel/elf.c')
-rw-r--r--src/kernel/elf.c2
1 files changed, 2 insertions, 0 deletions
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);