Cope with xonly on amd64 by moving the testfly routine to the rodata
authoranton <anton@openbsd.org>
Sun, 22 Jan 2023 16:38:36 +0000 (16:38 +0000)
committeranton <anton@openbsd.org>
Sun, 22 Jan 2023 16:38:36 +0000 (16:38 +0000)
section.

regress/sys/kern/noexec/testfly.S

index dc40440..50ffbc5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: testfly.S,v 1.11 2023/01/08 06:56:01 anton Exp $      */
+/*     $OpenBSD: testfly.S,v 1.12 2023/01/22 16:38:36 anton Exp $      */
 
 /*
  * Copyright (c) 2002,2003 Michael Shalayeff
 
 #include <machine/asm.h>
 
+#if !defined(_ASM_TYPE_FUNCTION)
+#define _ASM_TYPE_FUNCTION @function
+#endif
+
        .space 16384
 
-#if defined(__aarch64__)
+#if defined(__aarch64__) || defined(__amd64__)
        .section .rodata
        .globl  testfly
-       .type   testfly,#function
+       .type   testfly,_ASM_TYPE_FUNCTION
 testfly:
        ret
 END(testfly)
 #endif
 
-#if defined(__amd64__) || defined(__i386__)
+#if defined(__i386__)
 ENTRY(testfly)
        ret
 END(testfly)