about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-02-15 11:55:16 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-04-17 15:14:41 -0300
commitffe8a9a8318e1db225b22da8bc067408494bac5c (patch)
tree601c619deb524e26d7eeae63c6a8969435c527d6 /sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
parent0e169691290a6d2187a4ff41495fc5678cbfdcdc (diff)
downloadglibc-ffe8a9a8318e1db225b22da8bc067408494bac5c.tar.gz
glibc-ffe8a9a8318e1db225b22da8bc067408494bac5c.tar.xz
glibc-ffe8a9a8318e1db225b22da8bc067408494bac5c.zip
powerpc: Remove rt_sigreturn usage on context function
As described in a recent glibc thread [1], the rt_sigreturn syscall
on setcontext and swapcontext is not used on default use and its
intention is no really supported since neither setcontext nor
swapcontext are async-signal-safe.

Checked on powerpc64-linux-gnu and powerpc-linux-gnu.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
	Remove rt_sigreturn call.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Likewie.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.

[1] https://sourceware.org/ml/libc-alpha/2019-02/msg00367.html
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S22
1 files changed, 0 insertions, 22 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index 68c6321a9d..47235dd0cb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -47,21 +47,6 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	cfi_offset(r31,-4)
 	lwz	r31,_UC_REGS_PTR(r3)
 
-	/*
-	 * If this ucontext refers to the point where we were interrupted
-	 * by a signal, we have to use the rt_sigreturn system call to
-	 * return to the context so we get both LR and CTR restored.
-	 *
-	 * Otherwise, the context we are restoring is either just after
-	 * a procedure call (getcontext/swapcontext) or at the beginning
-	 * of a procedure call (makecontext), so we don't need to restore
-	 * r0, xer, ctr.  We don't restore r2 since it will be used as
-	 * the TLS pointer.
-	 */
-	lwz	r0,_UC_GREGS+(PT_MSR*4)(r31)
-	cmpwi	r0,0
-	bne	4f	/* L(do_sigret) */
-
 	/* Restore the signal mask */
 	li	r5,0
 	addi	r4,r3,_UC_SIGMASK
@@ -296,11 +281,4 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	mtlr	r0
 	blr
 
-
-4: /* L(do_sigret): */
-	addi	r1,r3,-0xd0
-	li	r0,SYS_ify(rt_sigreturn)
-	sc
-	/* NOTREACHED */
-
 END (__CONTEXT_FUNC_NAME)