From 9c067855df39165b9a140fc637d66169f471c3b7 Mon Sep 17 00:00:00 2001
From: Simon South <ssouth@simonsouth.com>
Date: Wed, 28 Oct 2015 09:53:43 -0400
Subject: [PATCH 2/2] x86_64: Glue code: Keep stack 16-byte-aligned
---
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 3ef8e5f..07d2d63 100644
a
|
b
|
FUNCTION(_init):
|
30 | 30 | |
31 | 31 | // Preserve image ID for call to __haiku_init_after. |
32 | 32 | push %rdi |
| 33 | sub $0x8, %rsp |
33 | 34 | |
34 | 35 | call __haiku_init_before |
35 | 36 | // crtbegin.o stuff comes here |
… |
… |
FUNCTION(_fini):
|
39 | 40 | push %rbp |
40 | 41 | movq %rsp, %rbp |
41 | 42 | push %rdi |
| 43 | sub $0x8, %rsp |
42 | 44 | call __haiku_term_before |
43 | 45 | // 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 8ed6433..6eb07e1 100644
a
|
b
|
|
13 | 13 | |
14 | 14 | .section .init |
15 | 15 | // The image ID is preserved on the stack. |
| 16 | add $0x8, %rsp |
16 | 17 | pop %rdi |
17 | 18 | call __haiku_init_after |
18 | 19 | movq %rbp, %rsp |
… |
… |
|
20 | 21 | ret |
21 | 22 | |
22 | 23 | .section .fini |
| 24 | add $0x8, %rsp |
23 | 25 | pop %rdi |
24 | 26 | call __haiku_term_after |
25 | 27 | movq %rbp, %rsp |