From 2d8d4fd2007943ce34279a82b33b7eca261cc448 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sun, 9 Apr 2023 15:20:17 -0700 Subject: [PATCH] [libc] Fix random SSE alignment GP faults The libc CRT _start function had a stray pop left in it, which was causing the stack to never be 16-byte aligned and thus causing crashes when SSE instructions were called. --- src/libraries/libc/arch/amd64/crt/crt0.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/libc/arch/amd64/crt/crt0.s b/src/libraries/libc/arch/amd64/crt/crt0.s index 5e4034a..2577e99 100644 --- a/src/libraries/libc/arch/amd64/crt/crt0.s +++ b/src/libraries/libc/arch/amd64/crt/crt0.s @@ -17,7 +17,7 @@ _libc_crt0_start: call __init_libc - pop rdi + mov rdi, 0 mov rsi, rsp mov rdx, 0 ; TODO: actually parse stack for argc, argv, envp mov rcx, rbx