From cac8399523560e52787028fe124bc03aaecc1ef0 Mon Sep 17 00:00:00 2001 From: niklas Date: Thu, 18 Apr 1996 15:58:33 +0000 Subject: [PATCH] Support mapping of page zero read-only if COMPAT_SVR4_MAP_PAGE_ZERO is used. Dell SVR4 behaved this way, and some binaries rely on such icky behaviour. --- sys/kern/exec_elf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index a32eaabe1b5..b07a0ded462 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.3 1996/03/03 17:19:37 niklas Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.4 1996/04/18 15:58:33 niklas Exp $ */ /* $NetBSD: exec_elf.c,v 1.6 1996/02/09 18:59:18 christos Exp $ */ /* @@ -531,6 +531,12 @@ exec_elf_makecmds(p, epp) } else epp->ep_entry = eh->e_entry; +#ifdef COMPAT_SVR4_MAP_PAGE_ZERO + /* Dell SVR4 maps page zero, yeuch! */ + NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, NBPG, 0, epp->ep_vp, 0, + VM_PROT_READ); +#endif + free((char *) ph, M_TEMP); epp->ep_vp->v_flag |= VTEXT; return exec_aout_setup_stack(p, epp); -- 2.20.1