Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Avoid plabels on hppa to make some tests ...



details:   https://anonhg.NetBSD.org/src/rev/3420816edc23
branches:  trunk
changeset: 366576:3420816edc23
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue May 31 07:12:15 2022 +0000

description:
Avoid plabels on hppa to make some tests not crash

diffstat:

 tests/lib/libc/arch/hppa/return_one.S  |  23 ++++++++++++++++++++++-
 tests/lib/libc/common/exec_prot.h      |   7 ++++++-
 tests/lib/libc/sys/t_mprotect_helper.c |   2 ++
 tests/lib/libc/sys/t_mprotect_helper.h |   6 ++++++
 4 files changed, 36 insertions(+), 2 deletions(-)

diffs (85 lines):

diff -r c6ba540d36df -r 3420816edc23 tests/lib/libc/arch/hppa/return_one.S
--- a/tests/lib/libc/arch/hppa/return_one.S     Tue May 31 07:10:50 2022 +0000
+++ b/tests/lib/libc/arch/hppa/return_one.S     Tue May 31 07:12:15 2022 +0000
@@ -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 @@
        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:
diff -r c6ba540d36df -r 3420816edc23 tests/lib/libc/common/exec_prot.h
--- a/tests/lib/libc/common/exec_prot.h Tue May 31 07:10:50 2022 +0000
+++ b/tests/lib/libc/common/exec_prot.h Tue May 31 07:12:15 2022 +0000
@@ -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.
diff -r c6ba540d36df -r 3420816edc23 tests/lib/libc/sys/t_mprotect_helper.c
--- a/tests/lib/libc/sys/t_mprotect_helper.c    Tue May 31 07:10:50 2022 +0000
+++ b/tests/lib/libc/sys/t_mprotect_helper.c    Tue May 31 07:12:15 2022 +0000
@@ -1,5 +1,6 @@
 #include "t_mprotect_helper.h"
 
+#ifndef __hppa__
 int
 return_1(void)
 {
@@ -15,3 +16,4 @@
 {
        return 3;
 }
+#endif
diff -r c6ba540d36df -r 3420816edc23 tests/lib/libc/sys/t_mprotect_helper.h
--- a/tests/lib/libc/sys/t_mprotect_helper.h    Tue May 31 07:10:50 2022 +0000
+++ b/tests/lib/libc/sys/t_mprotect_helper.h    Tue May 31 07:12:15 2022 +0000
@@ -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



Home | Main Index | Thread Index | Old Index