diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-03-03 17:20:29 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-03-03 17:20:29 +0000 |
commit | a69a4a568209bb69852224e2cd6f6394ed4da746 (patch) | |
tree | 35d8778bf8e995cb348c0bb9d78d38b7a7e6e356 /sys/kern/exec_elf.c | |
parent | 5aeba8440e8d2256e4b716030f97e3bf493b725a (diff) |
From NetBSD: 960217 merge
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r-- | sys/kern/exec_elf.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index e065eef5152..a32eaabe1b5 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,5 @@ -/* $NetBSD: exec_elf.c,v 1.4 1996/01/16 23:07:18 fvdl Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.3 1996/03/03 17:19:37 niklas Exp $ */ +/* $NetBSD: exec_elf.c,v 1.6 1996/02/09 18:59:18 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -55,7 +56,8 @@ #include <compat/svr4/svr4_exec.h> #endif -int (*elf_probe_funcs[])() = { +int (*elf_probe_funcs[]) __P((struct proc *, struct exec_package *, + char *, u_long *)) = { #ifdef COMPAT_SVR4 svr4_elf_probe, #endif @@ -64,6 +66,10 @@ int (*elf_probe_funcs[])() = { #endif }; +int elf_check_header __P((Elf32_Ehdr *, int)); +int elf_load_file __P((struct proc *, char *, struct exec_vmcmd_set *, + u_long *, struct elf_args *, u_long *)); + static int elf_read_from __P((struct proc *, struct vnode *, u_long, caddr_t, int)); static void elf_load_psection __P((struct exec_vmcmd_set *, @@ -493,6 +499,14 @@ exec_elf_makecmds(p, epp) } /* + * If no position to load the interpreter was set by a probe + * function, pick the same address that a non-fixed mmap(0, ..) + * would (i.e. something safely out of the way). + */ + if (pos == ELF32_NO_ADDR) + pos = round_page(epp->ep_daddr + MAXDSIZ); + + /* * Check if we found a dynamically linked binary and arrange to load * it's interpreter */ |