Module Name:    src
Committed By:   skrll
Date:           Tue May 31 07:12:15 UTC 2022

Modified Files:
        src/tests/lib/libc/arch/hppa: return_one.S
        src/tests/lib/libc/common: exec_prot.h
        src/tests/lib/libc/sys: t_mprotect_helper.c t_mprotect_helper.h

Log Message:
Avoid plabels on hppa to make some tests not crash


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/arch/hppa/return_one.S
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/common/exec_prot.h
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_mprotect_helper.c \
    src/tests/lib/libc/sys/t_mprotect_helper.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/arch/hppa/return_one.S
diff -u src/tests/lib/libc/arch/hppa/return_one.S:1.3 src/tests/lib/libc/arch/hppa/return_one.S:1.4
--- src/tests/lib/libc/arch/hppa/return_one.S:1.3	Tue May 31 07:10:50 2022
+++ src/tests/lib/libc/arch/hppa/return_one.S	Tue May 31 07:12:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: return_one.S,v 1.3 2022/05/31 07:10:50 skrll Exp $ */
+/*	$NetBSD: return_one.S,v 1.4 2022/05/31 07:12:15 skrll Exp $ */
 
 #include <machine/asm.h>
 
@@ -8,3 +8,24 @@ return_one:
 	bv	%r0(%r2)
 	 ldi	1,%r28
 return_one_end:
+
+.globl	return_1, return_1_end;
+
+return_1:
+	bv	%r0(%r2)
+	 ldi	1,%r28
+return_1_end:
+
+.globl	return_2, return_2_end;
+
+return_2:
+	bv	%r0(%r2)
+	 ldi	2,%r28
+return_2_end:
+
+.globl	return_3, return_3_end;
+
+return_3:
+	bv	%r0(%r2)
+	 ldi	3,%r28
+return_3_end:

Index: src/tests/lib/libc/common/exec_prot.h
diff -u src/tests/lib/libc/common/exec_prot.h:1.1 src/tests/lib/libc/common/exec_prot.h:1.2
--- src/tests/lib/libc/common/exec_prot.h:1.1	Mon Jul 18 23:16:11 2011
+++ src/tests/lib/libc/common/exec_prot.h	Tue May 31 07:12:15 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_prot.h,v 1.1 2011/07/18 23:16:11 jym Exp $ */
+/* $NetBSD: exec_prot.h,v 1.2 2022/05/31 07:12:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -40,8 +40,13 @@
 /*
  * Trivial MD shellcode that justs returns 1.
  */
+#ifdef __hppa__
+extern char return_one[];
+extern char return_one_end[];
+#else
 int return_one(void);     /* begin marker -- shellcode entry */
 int return_one_end(void); /* end marker */
+#endif
 
 /*
  * MD callback to verify whether host offers executable space protection.

Index: src/tests/lib/libc/sys/t_mprotect_helper.c
diff -u src/tests/lib/libc/sys/t_mprotect_helper.c:1.1 src/tests/lib/libc/sys/t_mprotect_helper.c:1.2
--- src/tests/lib/libc/sys/t_mprotect_helper.c:1.1	Sat Apr 18 17:44:53 2020
+++ src/tests/lib/libc/sys/t_mprotect_helper.c	Tue May 31 07:12:15 2022
@@ -1,5 +1,6 @@
 #include "t_mprotect_helper.h"
 
+#ifndef __hppa__
 int
 return_1(void)
 {
@@ -15,3 +16,4 @@ return_3(void)
 {
 	return 3;
 }
+#endif
Index: src/tests/lib/libc/sys/t_mprotect_helper.h
diff -u src/tests/lib/libc/sys/t_mprotect_helper.h:1.1 src/tests/lib/libc/sys/t_mprotect_helper.h:1.2
--- src/tests/lib/libc/sys/t_mprotect_helper.h:1.1	Sat Apr 18 17:45:16 2020
+++ src/tests/lib/libc/sys/t_mprotect_helper.h	Tue May 31 07:12:15 2022
@@ -1,3 +1,9 @@
+#ifdef __hppa__
+extern char return_1[];
+extern char return_2[];
+extern char return_3[];
+#else
 int return_1(void);
 int return_2(void);
 int return_3(void);
+#endif

Reply via email to