summaryrefslogtreecommitdiff
path: root/crt/x86_64
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-06-03 17:32:42 -0400
committerRich Felker <dalias@aerifal.cx>2013-06-03 17:32:42 -0400
commita6d272127bb6a2eb09dc182cc39c49e77310ade4 (patch)
tree519a62cc82bbd8b0edb0e886af2623be1653aa41 /crt/x86_64
parent44b4d09fc0626541ca12cf96f65adc21ab1fc413 (diff)
downloadmusl-a6d272127bb6a2eb09dc182cc39c49e77310ade4.tar.gz
musl-a6d272127bb6a2eb09dc182cc39c49e77310ade4.tar.bz2
musl-a6d272127bb6a2eb09dc182cc39c49e77310ade4.tar.xz
musl-a6d272127bb6a2eb09dc182cc39c49e77310ade4.zip
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.
Diffstat (limited to 'crt/x86_64')
-rw-r--r--crt/x86_64/crti.s2
-rw-r--r--crt/x86_64/crtn.s2
2 files changed, 4 insertions, 0 deletions
diff --git a/crt/x86_64/crti.s b/crt/x86_64/crti.s
index 2eb23ed5..4788968b 100644
--- a/crt/x86_64/crti.s
+++ b/crt/x86_64/crti.s
@@ -1,7 +1,9 @@
.section .init
.global _init
_init:
+ push %rax
.section .fini
.global _fini
_fini:
+ push %rax
diff --git a/crt/x86_64/crtn.s b/crt/x86_64/crtn.s
index 055451ed..29198b77 100644
--- a/crt/x86_64/crtn.s
+++ b/crt/x86_64/crtn.s
@@ -1,5 +1,7 @@
.section .init
+ pop %rax
ret
.section .fini
+ pop %rax
ret