mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 19:30:29 +00:00
Fix deterministic startup stack setup, especially for bare metal
This commit is contained in:
parent
d4744048ba
commit
e24f7afd10
1 changed files with 5 additions and 2 deletions
|
@ -99,6 +99,8 @@ cosmo: push %rbp
|
||||||
.init.start 304,_init_stack
|
.init.start 304,_init_stack
|
||||||
testb IsWindows()
|
testb IsWindows()
|
||||||
jnz 9f
|
jnz 9f
|
||||||
|
testb IsMetal()
|
||||||
|
jnz 9f
|
||||||
push %rdi
|
push %rdi
|
||||||
push %rsi
|
push %rsi
|
||||||
// allocate stack
|
// allocate stack
|
||||||
|
@ -120,8 +122,9 @@ cosmo: push %rbp
|
||||||
leave
|
leave
|
||||||
pop %rcx
|
pop %rcx
|
||||||
lea (%rax,%r8),%rsp
|
lea (%rax,%r8),%rsp
|
||||||
sub $ape_stack_align,%rsp # openbsd:stackbound
|
mov $ape_stack_align,%eax # openbsd:stackbound
|
||||||
mov %rbp,(%rsp)
|
neg %rax
|
||||||
|
and %rax,%rsp
|
||||||
push %rcx
|
push %rcx
|
||||||
push %rbp
|
push %rbp
|
||||||
mov %rsp,%rbp
|
mov %rsp,%rbp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue