From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1827) id 19B98386F02B; Tue, 12 May 2020 18:42:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19B98386F02B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tulio Magno Quites Machado Filho To: glibc-cvs@sourceware.org Subject: [glibc/ibm/2.30/master] hppa: Align __clone stack argument to 8 bytes (Bug 25066) X-Act-Checkin: glibc X-Git-Author: John David Anglin X-Git-Refname: refs/heads/ibm/2.30/master X-Git-Oldrev: 994e529a37953a057b9e6c80afa03b03fd3724f2 X-Git-Newrev: 43598ef6e2b1a8226db9f83dac9e93224306e242 Message-Id: <20200512184202.19B98386F02B@sourceware.org> Date: Tue, 12 May 2020 18:42:02 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:42:02 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=43598ef6e2b1a8226db9f83dac9e93224306e242 commit 43598ef6e2b1a8226db9f83dac9e93224306e242 Author: John David Anglin Date: Sun Nov 3 16:28:01 2019 -0500 hppa: Align __clone stack argument to 8 bytes (Bug 25066) 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) Diff: --- NEWS | 1 + sysdeps/unix/sysv/linux/hppa/clone.S | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 2c707f35ff..15df670edc 100644 --- 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 diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S index 79fa4f6147..1c0325e199 100644 --- a/sysdeps/unix/sysv/linux/hppa/clone.S +++ b/sysdeps/unix/sysv/linux/hppa/clone.S @@ -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 */