]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hppa: Align __clone stack argument to 8 bytes (Bug 25066)
authorJohn David Anglin <danglin@gcc.gnu.org>
Sun, 3 Nov 2019 21:28:01 +0000 (16:28 -0500)
committerAurelien Jarno <aurelien@aurel32.net>
Wed, 5 Feb 2020 21:13:40 +0000 (22:13 +0100)
The hppa architecture requires strict alignment for loads and stores.
As a result, the minimum stack alignment that will work is 8 bytes.
This patch adjusts __clone() to align the stack argument passed to it.
It also adjusts slightly some formatting.

This fixes the nptl/tst-tls1 test.

(cherry picked from commit e4c23a029a54c8c7788eff9ca771a01cccaaa0ce)

NEWS
sysdeps/unix/sysv/linux/hppa/clone.S

diff --git a/NEWS b/NEWS
index 2c707f35ff012631cef1fcdf4bee007ec65f80a4..15df670edc57903fa58259e8d9e9b934055c30ea 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
     unconditionally
   [24899] login: Add nonstring attributes to struct utmp, struct utmpx
   [24902] login: pututxline could fail to overwrite existing entries
+  [25066] FAIL: nptl/tst-tls1 on hppa
   [25189] Don't use a custom wrapper macro around __has_include
   [25203] libio: Disable vtable validation for pre-2.1 interposed handles
   [25204] Ignore LD_PREFER_MAP_32BIT_EXEC for SUID programs
index 79fa4f6147c599882b79a57b9ef4806731ed2e1a..1c0325e199b464ef798a22d8524f2f3ebf6ecca8 100644 (file)
@@ -73,13 +73,18 @@ ENTRY(__clone)
 #endif
 
        /* Sanity check arguments.  */
-       comib,=,n  0, %arg0, .LerrorSanity        /* no NULL function pointers */
-       comib,=,n  0, %arg1, .LerrorSanity        /* no NULL stack pointers */
+       comib,=,n       0,%arg0,.LerrorSanity   /* no NULL function pointers */
+       comib,=,n       0,%arg1,.LerrorSanity   /* no NULL stack pointers */
+
+       /* Ensure stack argument is 8-byte aligned.  */
+       ldo             7(%r25),%r25
+       depi            0,31,3,%r25
 
        /* Save the function pointer, arg, and flags on the new stack.  */
        stwm    %r26, 64(%r25)
        stw     %r23, -60(%r25)
        stw     %r24, -56(%r25)
+
        /* Clone arguments are (int flags, void * child_stack) */
        copy    %r24, %r26              /* flags are first */
        /* User stack pointer is in the correct register already */