diff --git a/libc/x64/crt1.s b/libc/x64/crt1.s index bd1e7deb..f3e604c6 100644 --- a/libc/x64/crt1.s +++ b/libc/x64/crt1.s @@ -34,6 +34,12 @@ .global _start .type _start, @function _start: + # Set up end of the stack frame linked list. + xorl %ebp, %ebp + pushq %rbp # rip=0 + pushq %rbp # rbp=0 + movq %rsp, %rbp + movq %rcx, environ # envp # Prepare signals, memory allocation, stdio and such. diff --git a/libc/x86/crt1.s b/libc/x86/crt1.s index 98bf2422..4e2f8e85 100644 --- a/libc/x86/crt1.s +++ b/libc/x86/crt1.s @@ -34,6 +34,12 @@ .global _start .type _start, @function _start: + # Set up end of the stack frame linked list. + xorl %ebp, %ebp + pushl %ebp # rip=0 + pushl %ebp # rbp=0 + movl %esp, %ebp + movl %ecx, environ # envp # Arguments for main