public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] ARC: align child stack in clone
@ 2023-02-17 19:15 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2023-02-17 19:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6

commit 87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6
Author: Pavel Kozlov <pavel.kozlov@synopsys.com>
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  <adhemerval.zanella@linaro.org>

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-17 19:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 19:15 [glibc] ARC: align child stack in clone Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).