From 10ae2e6ebc7e9776b9f124c9fc530c79f5e84460 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 2 Dec 2022 21:12:11 +0200 Subject: initial shared memory working --- common/elf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/elf.c') 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); -- cgit v1.3