From 874e9521b2bcdbe346bafe6ef4c59f106cc80327 Mon Sep 17 00:00:00 2001 From: Simon South Date: Wed, 28 Oct 2015 09:53:43 -0400 Subject: [PATCH] x86_64: Glue code: Keep stack 16-byte-aligned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Duval --- src/system/glue/arch/x86_64/crti.S | 2 ++ src/system/glue/arch/x86_64/crtn.S | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/system/glue/arch/x86_64/crti.S b/src/system/glue/arch/x86_64/crti.S index 3ef8e5f8df..ec26b6d5a3 100644 --- a/src/system/glue/arch/x86_64/crti.S +++ b/src/system/glue/arch/x86_64/crti.S @@ -30,6 +30,7 @@ FUNCTION(_init): // Preserve image ID for call to __haiku_init_after. push %rdi + sub $0x8, %rsp call __haiku_init_before // crtbegin.o stuff comes here @@ -39,5 +40,6 @@ FUNCTION(_fini): push %rbp movq %rsp, %rbp push %rdi + sub $0x8, %rsp call __haiku_term_before // crtend.o stuff comes here diff --git a/src/system/glue/arch/x86_64/crtn.S b/src/system/glue/arch/x86_64/crtn.S index 8ed6433843..6eb07e181a 100644 --- a/src/system/glue/arch/x86_64/crtn.S +++ b/src/system/glue/arch/x86_64/crtn.S @@ -13,6 +13,7 @@ .section .init // The image ID is preserved on the stack. + add $0x8, %rsp pop %rdi call __haiku_init_after movq %rbp, %rsp @@ -20,6 +21,7 @@ ret .section .fini + add $0x8, %rsp pop %rdi call __haiku_term_after movq %rbp, %rsp