From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 123E93857B93; Fri, 17 Feb 2023 19:15:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 123E93857B93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676661330; bh=Go6r0J2WV9gvxgNL63gF9NXzzuyY01PdhFWA48OXpqI=; h=From:To:Subject:Date:From; b=JtjTnvlnsMbU4t1m1y4pIKwOA/FOj6KGAP8UohpgEscfo/jEU3lgwDh2Xen4jJcXz 2XoZJrrXtXRRI67/5CbJzhUOnOl0ePCp3QPyYI3Inbk0LxseMIj+i52iV1+AgXHt5n SObwAZfLZMxnjVM2zvuiX2ubvT/8F7PIp4OO6uro= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] ARC: align child stack in clone X-Act-Checkin: glibc X-Git-Author: Pavel Kozlov X-Git-Refname: refs/heads/master X-Git-Oldrev: a9b3b770f596c9f9fd059f5a90a4e1db3c4f3835 X-Git-Newrev: 87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6 Message-Id: <20230217191530.123E93857B93@sourceware.org> Date: Fri, 17 Feb 2023 19:15:30 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6 commit 87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6 Author: Pavel Kozlov Date: Wed Dec 21 20:19:46 2022 +0400 ARC: align child stack in clone The ARCv2 ABI requires 4 byte stack pointer alignment. Don't allow to use unaligned child stack in clone. As the stack grows down, align it down. This was pointed by misc/tst-misalign-clone-internal and misc/tst-misalign-clone tests. Stack alignmet fixes these tests fails. Reviewed-by: Adhemerval Zanella Diff: --- sysdeps/unix/sysv/linux/arc/clone.S | 1 + 1 file changed, 1 insertion(+) diff --git a/sysdeps/unix/sysv/linux/arc/clone.S b/sysdeps/unix/sysv/linux/arc/clone.S index e41a5942eb..7666496256 100644 --- a/sysdeps/unix/sysv/linux/arc/clone.S +++ b/sysdeps/unix/sysv/linux/arc/clone.S @@ -41,6 +41,7 @@ ENTRY (__clone) cmp r0, 0 /* @fn can't be NULL. */ + and r1,r1,-4 /* @child_stack be 4 bytes aligned per ABI. */ cmp.ne r1, 0 /* @child_stack can't be NULL. */ bz L (__sys_err)