summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Kozlov <pavel.kozlov@synopsys.com>2022-12-21 20:19:46 +0400
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-17 16:12:52 -0300
commit87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6 (patch)
tree47c2a3a396560d3e66930d45bc9cef87c99d94a2
parenta9b3b770f596c9f9fd059f5a90a4e1db3c4f3835 (diff)
downloadglibc-87abcf9a6e34d64f556b0b9d3ccd2689b2c2e0b6.tar.gz
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>
-rw-r--r--sysdeps/unix/sysv/linux/arc/clone.S1
1 files changed, 1 insertions, 0 deletions
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)