diff options
| author | fvdl <fvdl@NetBSD.org> | 2005-03-26 05:12:34 +0000 |
|---|---|---|
| committer | fvdl <fvdl@NetBSD.org> | 2005-03-26 05:12:34 +0000 |
| commit | c487efe4a7d111350f5ca35b238e111ed3049431 (patch) | |
| tree | abc8c3e2cecea1c33c66b303d7edfe39441ad6b3 /sys/kern/exec_elf32.c | |
| parent | 049130f10b2a5e7f1e6e1f060c5e02cecd46eb9a (diff) | |
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
that will return the default VM map address. The default function
is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
macro. This gives emulations control over the default map address,
and allows things to be mapped at the right address (in 32bit range)
for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2
Tested on amd64, compile-tested on sparc64.
Diffstat (limited to 'sys/kern/exec_elf32.c')
| -rw-r--r-- | sys/kern/exec_elf32.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/exec_elf32.c b/sys/kern/exec_elf32.c index 31858205435..b339b494f95 100644 --- a/sys/kern/exec_elf32.c +++ b/sys/kern/exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf32.c,v 1.102 2005/03/02 11:05:34 mycroft Exp $ */ +/* $NetBSD: exec_elf32.c,v 1.103 2005/03/26 05:12:36 fvdl Exp $ */ /*- * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.102 2005/03/02 11:05:34 mycroft Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.103 2005/03/26 05:12:36 fvdl Exp $"); /* If not included by exec_elf64.c, ELFSIZE won't be defined. */ #ifndef ELFSIZE @@ -423,7 +423,8 @@ ELFNAME(load_file)(struct proc *p, struct exec_package *epp, char *path, /* * Now compute the size and load address. */ - addr = VM_DEFAULT_ADDRESS(epp->ep_daddr, + addr = (*epp->ep_esch->es_emul->e_vm_default_addr)(p, + epp->ep_daddr, round_page(limit) - trunc_page(base_ph->p_vaddr)); } else addr = *last; /* may be ELF_LINK_ADDR */ |
