]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Restore r31 setting in powerpc32 swapcontext.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 30 Jul 2019 14:05:11 +0000 (14:05 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 30 Jul 2019 14:05:11 +0000 (14:05 +0000)
Commit ffe8a9a8318e1db225b22da8bc067408494bac5c, "powerpc: Remove
rt_sigreturn usage on context function", removed from powerpc32
swapcontext a setting of r31 that is relied upon in subsequent code.
I'm not sure why this didn't produce test failures in Adhemerval's
32-bit testing; in my (soft-float) testing in preparation for 2.30
release, I see several context-related failures

FAIL: stdlib/tst-makecontext2
FAIL: stdlib/tst-makecontext3
FAIL: stdlib/tst-setcontext
FAIL: stdlib/tst-setcontext2
FAIL: stdlib/tst-setcontext4
FAIL: stdlib/tst-setcontext7
FAIL: stdlib/tst-setcontext9
FAIL: stdlib/tst-swapcontext1

that did not appear in 2.29 testing.  This patch restores the removed
register setting in question, and thus fixes those failures.

Tested for powerpc (soft-float).

* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
(__CONTEXT_FUNC_NAME): Restore setting of r31.

ChangeLog
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S

index a5384542a8c6ebcf349670e2abfcf4aab906c0e3..6b46bfa09d8a509cc3aac74cb777896dc48afa76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-30  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+       (__CONTEXT_FUNC_NAME): Restore setting of r31.
+
 2019-07-30  Florian Weimer  <fweimer@redhat.com>
 
        * nptl/tst-pthread-getattr.c (allocate_and_test): Change return
index efebb10bba44e43e042c4e6254e596f033f24e75..6fa1ab7d6e847b02dc07cf08d996f71d54c1f1b8 100644 (file)
@@ -276,6 +276,9 @@ ENTRY(__CONTEXT_FUNC_NAME)
        cmpwi   r3,0
        bne     3f      /* L(error_exit) */
 
+       lwz     r4,_FRAME_PARM_SAVE2(r1)
+       lwz     r31,_UC_REGS_PTR(r4)
+
 #ifdef __CONTEXT_ENABLE_FPRS
 # ifdef __CONTEXT_ENABLE_VRS