From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129918 invoked by alias); 3 Nov 2019 21:29:54 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 129872 invoked by uid 9150); 3 Nov 2019 21:29:53 -0000 Date: Sun, 03 Nov 2019 21:29:00 -0000 Message-ID: <20191103212953.129870.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: John David Anglin To: glibc-cvs@sourceware.org Subject: [glibc] 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/master X-Git-Oldrev: 42893aa38fd6041d349ea0427c4d5ccbacd9a2be X-Git-Newrev: e4c23a029a54c8c7788eff9ca771a01cccaaa0ce X-SW-Source: 2019-q4/txt/msg00269.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e4c23a029a54c8c7788eff9ca771a01cccaaa0ce commit e4c23a029a54c8c7788eff9ca771a01cccaaa0ce 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. Diff: --- sysdeps/unix/sysv/linux/hppa/clone.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S index 6db2cb5..372d29a 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 */