summaryrefslogtreecommitdiffstats
path: root/sys/kern/exec_elf.c
diff options
context:
space:
mode:
authorniklas <niklas@openbsd.org>1996-04-18 15:58:33 +0000
committerniklas <niklas@openbsd.org>1996-04-18 15:58:33 +0000
commitcac8399523560e52787028fe124bc03aaecc1ef0 (patch)
tree709e9344a3c091f6e07ff16b86dfc0d5a9c680e4 /sys/kern/exec_elf.c
parentAdd stray interrupts counters. (diff)
downloadwireguard-openbsd-cac8399523560e52787028fe124bc03aaecc1ef0.tar.xz
wireguard-openbsd-cac8399523560e52787028fe124bc03aaecc1ef0.zip
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.
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r--sys/kern/exec_elf.c8
1 files changed, 7 insertions, 1 deletions
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);