aboutsummaryrefslogtreecommitdiff
path: root/common/elf.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-12-02 21:12:11 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-12-02 21:12:11 +0200
commit10ae2e6ebc7e9776b9f124c9fc530c79f5e84460 (patch)
tree6687cf98db623f8c38c5d5aea234014a27302e10 /common/elf.c
parent131af4eec38752a27e6e56579fbf76178e022ec1 (diff)
downloadkmi-10ae2e6ebc7e9776b9f124c9fc530c79f5e84460.tar.gz
kmi-10ae2e6ebc7e9776b9f124c9fc530c79f5e84460.zip
initial shared memory working
Diffstat (limited to 'common/elf.c')
-rw-r--r--common/elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/elf.c b/common/elf.c
index fcd6e85..f423fc5 100644
--- a/common/elf.c
+++ b/common/elf.c
@@ -54,7 +54,7 @@ static void __map_exec(struct tcb *t, vm_t bin, uint8_t ei_c, vm_t phstart,
* segment fits into it */
/** \todo check if p_memsz is larger than p_filesz, the segment should be
* filled with zeroes. */
- /** \todo in general, make this a low more clean. */
+ /** \todo in general, make this a lot more clean. */
/* useful bit of info: all segments are sorted in ascending order of p_vaddr */
vm_t runner = phstart;
vmflags_t default_flags = VM_V | VM_R | VM_W | VM_X | VM_U;
@@ -74,6 +74,7 @@ static void __map_exec(struct tcb *t, vm_t bin, uint8_t ei_c, vm_t phstart,
uint8_t uvflags = __elf_to_uvflags(elf_flags);
map_allocd_region(t->proc.vmem, start, vsz, default_flags, 0);
+ memset((void *)start, 0, vsz);
vm_t vo = bin + program_header_prop(ei_c, runner, p_offset);
vm_t vfz = program_header_prop(ei_c, runner, p_filesz);