Module Name: src Committed By: reinoud Date: Sat Aug 27 17:53:21 UTC 2011
Modified Files: src/sys/kern: exec_elf.c Log Message: In execve1(), don't assume VM_MIN_ADDRESS is 0 for PIE executables. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/kern/exec_elf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/exec_elf.c diff -u src/sys/kern/exec_elf.c:1.31 src/sys/kern/exec_elf.c:1.32 --- src/sys/kern/exec_elf.c:1.31 Tue Aug 2 16:44:01 2011 +++ src/sys/kern/exec_elf.c Sat Aug 27 17:53:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf.c,v 1.31 2011/08/02 16:44:01 christos Exp $ */ +/* $NetBSD: exec_elf.c,v 1.32 2011/08/27 17:53:21 reinoud Exp $ */ /*- * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.31 2011/08/02 16:44:01 christos Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.32 2011/08/27 17:53:21 reinoud Exp $"); #ifdef _KERNEL_OPT #include "opt_pax.h" @@ -152,6 +152,8 @@ #endif /* PAX_ASLR */ offset = MAX(align, PAGE_SIZE); + offset += epp->ep_vm_minaddr; + for (i = 0; i < eh->e_phnum; i++) ph[i].p_vaddr += offset; eh->e_entry += offset;