From 9d741144290ccbc0fa7905a4b2359a24d7606fbd Mon Sep 17 00:00:00 2001 From: Kurt Miller Date: Fri, 18 Jul 2008 16:40:18 +0000 Subject: Add new uvm function called uvm_map_pie() which takes align as a parameter and returns an aligned random load address for position independent executables to use. This also adds three new vmparam.h defines to specify the maximum address, minimum address and minimum allowed alignment for uvm_map_pie() to use. The PIE address range for i386 was carefully selected to work well within the i386 W^X framework. With much help and feedback from weingart@. okay weingart@, miod@, kettenis@, drahn@ --- sys/arch/i386/include/vmparam.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/arch/i386/include/vmparam.h') diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h index e871997fd43..9c2163e6c2d 100644 --- a/sys/arch/i386/include/vmparam.h +++ b/sys/arch/i386/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.40 2008/06/24 21:24:03 deraadt Exp $ */ +/* $OpenBSD: vmparam.h,v 1.41 2008/07/18 16:40:17 kurt Exp $ */ /* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */ /*- @@ -77,6 +77,10 @@ /* I386 has a line where all code is executable: 0 - I386_MAX_EXE_ADDR */ #define I386_MAX_EXE_ADDR 0x20000000 /* exec line */ +/* map PIE into 320MB - 448MB address range */ +#define VM_PIE_MIN_ADDR 0x14000000 +#define VM_PIE_MAX_ADDR 0x1C000000 + /* * Size of shared memory map */ -- cgit v1.2.3