Set up initial stack frame as zero pointer.

This allows call traces to know when they are done.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-12-07 20:35:00 +01:00
parent 27fda0c0eb
commit 9411784b58
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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