From 0b8bde25a5a5cf1d314c7966aeffac5ca7aa05ed Mon Sep 17 00:00:00 2001 From: Max Wash Date: Tue, 5 Jan 2021 14:21:24 +0000 Subject: [PATCH] Updated magenta crt stack alignment --- photon/libc/sys/magenta/machine/x86_64/crt0.s | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/photon/libc/sys/magenta/machine/x86_64/crt0.s b/photon/libc/sys/magenta/machine/x86_64/crt0.s index a5608c1..e54ad16 100644 --- a/photon/libc/sys/magenta/machine/x86_64/crt0.s +++ b/photon/libc/sys/magenta/machine/x86_64/crt0.s @@ -8,8 +8,9 @@ .type main, @function _start: - mov %rsp, %rsi - andq $-16, %rsp + # Magenta aligns the stack to a page boundry and subtracts 8. + # Add 8 to restore 16-byte alignment + add $8, %rsp call __crt_init # unreachable; __crt_init() will call mx_task_kill()