Module Name:    src
Committed By:   skrll
Date:           Fri Nov 23 11:38:07 UTC 2018

Modified Files:
        src/lib/libc/arch/aarch64/gen: swapcontext.S

Log Message:
Fix so the setcontext call is via the PLT and libpthread can override


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/swapcontext.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/aarch64/gen/swapcontext.S
diff -u src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2 src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3
--- src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2	Wed Nov 21 21:04:15 2018
+++ src/lib/libc/arch/aarch64/gen/swapcontext.S	Fri Nov 23 11:38:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $ */
+/* $NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-        RCSID("$NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $")
+        RCSID("$NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 /* LINTSTUB: int swapcontext(ucontext_t * restrict, ucontext_t * restrict); */
@@ -58,7 +58,9 @@ ENTRY(swapcontext)
 	str	x4, [x2, #_UC_REGS_SP]	/* Adjust saved SP. */
 	str	x30, [x2, #_UC_REGS_PC]	/* Adjust saved PC. */
 
-	cbz	x3, _C_LABEL(setcontext)/* setcontext if getcontext succeeded */
+	cbnz	x3, 1f
+	b	_C_LABEL(setcontext)	/* setcontext if getcontext succeeded */
+1:
 	mov	x0, x3			/* restore getcontext return value */
 	ret				/* return on error from getcontext */
 END(swapcontext)

Reply via email to