CVS commit: [netbsd-9] src/lib/libc/arch/hppa/sys

2022-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun  6 11:31:13 UTC 2022

Modified Files:
src/lib/libc/arch/hppa/sys [netbsd-9]: ptrace.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1464):

lib/libc/arch/hppa/sys/ptrace.S: revision 1.8

Save and restore %r19 the "linkage table pointer register" across the call
to __cerror so if the ptrace syscall fails we can call __cerror again with
the correct %r19 value.

Do this even though the call of __cerror doesn't go via the PLT because
__cerror calls __errno which does.

Analysis and fix from Tom Lane in
PR port-hppa/56864: hppa: ptrace(2) dumps core when returning an error

I changed the location of where %r19 is stored on the stack to follow the
ABI.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.66.1 src/lib/libc/arch/hppa/sys/ptrace.S

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

Modified files:

Index: src/lib/libc/arch/hppa/sys/ptrace.S
diff -u src/lib/libc/arch/hppa/sys/ptrace.S:1.6 src/lib/libc/arch/hppa/sys/ptrace.S:1.6.66.1
--- src/lib/libc/arch/hppa/sys/ptrace.S:1.6	Mon Apr 28 20:22:56 2008
+++ src/lib/libc/arch/hppa/sys/ptrace.S	Mon Jun  6 11:31:13 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.S,v 1.6 2008/04/28 20:22:56 martin Exp $	*/
+/*	$NetBSD: ptrace.S,v 1.6.66.1 2022/06/06 11:31:13 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,10 +44,12 @@ ENTRY(ptrace, HPPA_FRAME_SIZE)
 	stw	%arg1, HPPA_FRAME_ARG(1)(%sp)
 	stw	%arg2, HPPA_FRAME_ARG(2)(%sp)
 	stw	%arg3, HPPA_FRAME_ARG(3)(%sp)
+	stw	%r19, HPPA_FRAME_EDP(%sp)
 	ldo	HPPA_FRAME_SIZE(%sp),%sp
 	bl	__cerror, %rp
 	 copy	%r0, %t1
 	ldo	-HPPA_FRAME_SIZE(%sp), %sp
+	ldw	HPPA_FRAME_EDP(%sp), %r19
 	ldw	HPPA_FRAME_ARG(0)(%sp), %arg0
 	ldw	HPPA_FRAME_ARG(1)(%sp), %arg1
 	ldw	HPPA_FRAME_ARG(2)(%sp), %arg2



CVS commit: [netbsd-9] src/lib/libc/arch/hppa/sys

2022-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun  6 11:31:13 UTC 2022

Modified Files:
src/lib/libc/arch/hppa/sys [netbsd-9]: ptrace.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1464):

lib/libc/arch/hppa/sys/ptrace.S: revision 1.8

Save and restore %r19 the "linkage table pointer register" across the call
to __cerror so if the ptrace syscall fails we can call __cerror again with
the correct %r19 value.

Do this even though the call of __cerror doesn't go via the PLT because
__cerror calls __errno which does.

Analysis and fix from Tom Lane in
PR port-hppa/56864: hppa: ptrace(2) dumps core when returning an error

I changed the location of where %r19 is stored on the stack to follow the
ABI.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.66.1 src/lib/libc/arch/hppa/sys/ptrace.S

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