summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2024-03-26 19:12:35 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2024-03-26 19:12:35 +0000
commit53adf19d041f776dc67ecb1277a185f1cc39ca3c (patch)
treec06427345a135b994a529431dfe28c1261a8d12d
parent390ea483cb7da7007b07ecd6594dd396ae4acbb8 (diff)
add cfi instructions to repair this test on amd64 and arm64.
ok kettenis@
-rw-r--r--regress/sys/kern/noexec/testfly.S15
1 files changed, 13 insertions, 2 deletions
diff --git a/regress/sys/kern/noexec/testfly.S b/regress/sys/kern/noexec/testfly.S
index 50ffbc57528..afe29e6ac37 100644
--- a/regress/sys/kern/noexec/testfly.S
+++ b/regress/sys/kern/noexec/testfly.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: testfly.S,v 1.12 2023/01/22 16:38:36 anton Exp $ */
+/* $OpenBSD: testfly.S,v 1.13 2024/03/26 19:12:34 miod Exp $ */
/*
* Copyright (c) 2002,2003 Michael Shalayeff
@@ -36,11 +36,22 @@
.space 16384
-#if defined(__aarch64__) || defined(__amd64__)
+#if defined(__aarch64__)
.section .rodata
.globl testfly
.type testfly,_ASM_TYPE_FUNCTION
testfly:
+ bti c
+ ret
+END(testfly)
+#endif
+
+#if defined(__amd64__)
+ .section .rodata
+ .globl testfly
+ .type testfly,_ASM_TYPE_FUNCTION
+testfly:
+ endbr64
ret
END(testfly)
#endif