diff --git a/executer/include/uprotocol.h b/executer/include/uprotocol.h index 722efbee..6ef3a2b5 100644 --- a/executer/include/uprotocol.h +++ b/executer/include/uprotocol.h @@ -25,7 +25,8 @@ struct program_image_section { unsigned long remote_pa; unsigned long filesz, offset; int prot; - int padding; + unsigned char interp; + unsigned char padding[3]; void *fp; }; diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index 642a1e7b..48535136 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -145,6 +145,7 @@ struct program_load_desc *load_elf(FILE *fp, char **interp_pathp) desc->sections[j].filesz = phdr.p_filesz; desc->sections[j].offset = phdr.p_offset; desc->sections[j].len = phdr.p_memsz; + desc->sections[j].interp = 0; desc->sections[j].fp = fp; desc->sections[j].prot = PROT_NONE; @@ -255,6 +256,7 @@ struct program_load_desc *load_interp(struct program_load_desc *desc0, FILE *fp) desc->sections[j].filesz = phdr.p_filesz; desc->sections[j].offset = phdr.p_offset; desc->sections[j].len = phdr.p_memsz; + desc->sections[j].interp = 1; desc->sections[j].fp = fp; desc->sections[j].prot = PROT_NONE; diff --git a/kernel/host.c b/kernel/host.c index beec8bd9..b57120e1 100644 --- a/kernel/host.c +++ b/kernel/host.c @@ -133,7 +133,10 @@ static int process_msg_prepare_process(unsigned long rphys) p->sections[i].remote_pa = up; /* TODO: Maybe we need flag */ - if (i == 0) { + if (pn->sections[i].interp) { + /* nothing to do */ + } + else if (i == 0) { proc->vm->region.text_start = s; proc->vm->region.text_end = e; } else if (i == 1) { diff --git a/kernel/include/syscall.h b/kernel/include/syscall.h index 744c6d04..1907287d 100644 --- a/kernel/include/syscall.h +++ b/kernel/include/syscall.h @@ -84,7 +84,8 @@ struct program_image_section { unsigned long remote_pa; unsigned long filesz, offset; int prot; - int padding; + unsigned char interp; + unsigned char padding[3]; void *fp; };