mirror of git://git.musl-libc.org/musl
align stack properly for calling global ctors/dtors on x86[_64]
failure to do so was causing crashes on x86_64 when ctors used SSE, which was first observed when ctors called variadic functions due to the SSE prologue code inserted into every variadic function.
This commit is contained in:
parent
44b4d09fc0
commit
a6d272127b
|
@ -1,7 +1,9 @@
|
|||
.section .init
|
||||
.global _init
|
||||
_init:
|
||||
sub $12,%esp
|
||||
|
||||
.section .fini
|
||||
.global _fini
|
||||
_fini:
|
||||
sub $12,%esp
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
.section .init
|
||||
add $12,%esp
|
||||
ret
|
||||
|
||||
.section .fini
|
||||
add $12,%esp
|
||||
ret
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
.section .init
|
||||
.global _init
|
||||
_init:
|
||||
push %rax
|
||||
|
||||
.section .fini
|
||||
.global _fini
|
||||
_fini:
|
||||
push %rax
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
.section .init
|
||||
pop %rax
|
||||
ret
|
||||
|
||||
.section .fini
|
||||
pop %rax
|
||||
ret
|
||||
|
|
Loading…
Reference in New Issue