diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-24 21:18:55 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-05-24 21:18:55 +0300 |
| commit | e033569910aecb4d8fb437a622e542b8803834ec (patch) | |
| tree | b7e31d1b266dfbd3b1aa79ae4db47d584541c8bc /common/elf.c | |
| parent | 12be40e22aae582cca9abbd151031edaab800cae (diff) | |
| download | kmi-e033569910aecb4d8fb437a622e542b8803834ec.tar.gz kmi-e033569910aecb4d8fb437a622e542b8803834ec.zip | |
initial musings about exec
Diffstat (limited to 'common/elf.c')
| -rw-r--r-- | common/elf.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); } |
