From e033569910aecb4d8fb437a622e542b8803834ec Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 24 May 2022 21:18:55 +0300 Subject: initial musings about exec --- common/elf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/elf.c') diff --git a/common/elf.c b/common/elf.c index 97d8fd7..b88be89 100644 --- a/common/elf.c +++ b/common/elf.c @@ -76,7 +76,7 @@ static vm_t __map_dyn(struct tcb *t, vm_t bin, uint8_t ei_c, vm_t phstart, * hacky, I know.*/ } -static vm_t __prepare_proc(struct tcb *t, uint8_t ei_c, vm_t elf) +static vm_t __prepare_proc(struct tcb *t, uint8_t ei_c, vm_t elf, vm_t interp) { short e_type = elf_header_prop(ei_c, elf, e_type); if (e_type != ET_DYN && e_type != ET_EXEC) @@ -97,9 +97,9 @@ static vm_t __prepare_proc(struct tcb *t, uint8_t ei_c, vm_t elf) } /* sets up all memory regions etc, returns the entry address */ -vm_t load_elf(struct tcb *t, vm_t b) +vm_t load_elf(struct tcb *t, vm_t elf, vm_t interp) { - struct elf_ident *i = (struct elf_ident *)b; + struct elf_ident *i = (struct elf_ident *)elf; if (i->ei_magic != cpu_to_be32(EI_MAGIC)) return 0; @@ -107,5 +107,5 @@ vm_t load_elf(struct tcb *t, vm_t b) return 0; /* more sanity checks? */ - return __prepare_proc(t, i->ei_class, b); + return __prepare_proc(t, i->ei_class, elf, interp); } -- cgit v1.3