summaryrefslogtreecommitdiff
path: root/regress/sys/kern/noexec
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sys/kern/noexec')
-rw-r--r--regress/sys/kern/noexec/Makefile26
-rw-r--r--regress/sys/kern/noexec/noexec.c6
2 files changed, 20 insertions, 12 deletions
diff --git a/regress/sys/kern/noexec/Makefile b/regress/sys/kern/noexec/Makefile
index 754e928cf85..b0110210278 100644
--- a/regress/sys/kern/noexec/Makefile
+++ b/regress/sys/kern/noexec/Makefile
@@ -1,14 +1,10 @@
-# $OpenBSD: Makefile,v 1.15 2016/09/01 10:12:35 tedu Exp $
+# $OpenBSD: Makefile,v 1.16 2017/07/18 23:00:31 bluhm Exp $
-.if ${MACHINE} == "sparc64" || \
- ${MACHINE} == "alpha" || ${MACHINE} == "armv7" || \
- ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || \
- ${MACHINE} == "hppa"
+PROG= noexec
+SRCS= noexec.c testfly.S
+CFLAGS= -Wall -fno-inline
+LDSTATIC= ${STATIC}
-PROG= noexec
-SRCS= noexec.c testfly.S
-CFLAGS+=-Wall
-LDSTATIC= ${STATIC}
REGRESS_TARGETS= nxtext-mmap nxtext-mprotect \
nxdata nxdata-mmap nxdata-mprotect \
nxbss nxbss-mmap nxbss-mprotect \
@@ -66,8 +62,16 @@ nxmmap: ${PROG}
nxmmap-mprotect: ${PROG}
@./${PROG} -m -p
-.else
-REGRESS_TARGETS= # this architecture has no test for this
+.if ${MACHINE} != "alpha" && \
+ ${MACHINE} != "amd64" && \
+ ${MACHINE} != "armv7" && \
+ ${MACHINE} != "hppa" && \
+ ${MACHINE} != "i386" && \
+ ${MACHINE} != "sparc64"
+REGRESS_TARGETS=run-regress-skiparch
+run-regress-skiparch:
+ # this architecture has no test for this
+ @echo SKIPPED
.endif
.include <bsd.regress.mk>
diff --git a/regress/sys/kern/noexec/noexec.c b/regress/sys/kern/noexec/noexec.c
index 6d8b047457a..6e3d70b5ba4 100644
--- a/regress/sys/kern/noexec/noexec.c
+++ b/regress/sys/kern/noexec/noexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: noexec.c,v 1.16 2016/09/24 07:26:14 otto Exp $ */
+/* $OpenBSD: noexec.c,v 1.17 2017/07/18 23:00:31 bluhm Exp $ */
/*
* Copyright (c) 2002,2003 Michael Shalayeff
@@ -120,6 +120,10 @@ getaddr(void *a)
{
void *ret;
+ /*
+ * Compile with -fno-inline to get reasonable result when comparing
+ * local variable address with caller's stack.
+ */
if ((void *)&ret < a)
ret = (void *)((u_long)&ret - 4 * page_size);
else