From e8b61e6d7f36a3fd237df0b39021aaf1e7ad32b2 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sat, 25 Jan 2025 00:08:46 +0200 Subject: [PATCH] userspace/libc: fix stack alignment Signed-off-by: EnderIce2 --- Userspace/libc/runtime/crt1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userspace/libc/runtime/crt1.c b/Userspace/libc/runtime/crt1.c index 99cf28df..2902b4a9 100644 --- a/Userspace/libc/runtime/crt1.c +++ b/Userspace/libc/runtime/crt1.c @@ -40,9 +40,8 @@ void __crt_fini_array(void) __attribute__((naked, used, no_stack_protector, section(".text"))) void _start() { #if defined(__amd64__) - asm("movq $0, %rbp\n" - "pushq %rbp\n" - "pushq %rbp\n" + asm("xor %rbp, %rbp\n" + "andq $-16, %rsp\n" "movq %rsp, %rbp\n" "pushq %rcx\n"