summaryrefslogtreecommitdiffstats
path: root/lib/csu
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2005-05-19 07:31:06 +0000
committerdfr <dfr@FreeBSD.org>2005-05-19 07:31:06 +0000
commite6963ec512a47d09e5f7ae62feb3ab7786a89598 (patch)
treec38eed0e2677d3f8dd959aa6bbc8ee7ff5aa9c12 /lib/csu
parentfcd83e98ec23a28b546877a0b93f0025e233c6a9 (diff)
downloadFreeBSD-src-e6963ec512a47d09e5f7ae62feb3ab7786a89598.zip
FreeBSD-src-e6963ec512a47d09e5f7ae62feb3ab7786a89598.tar.gz
Keep the stack aligned to a 16 byte boundary when calling init functions
so that we don't cause a bus error if they start storing SSE math stuff on the stack. MFC After: 1 week
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/i386-elf/crti.S2
-rw-r--r--lib/csu/i386-elf/crtn.S2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/csu/i386-elf/crti.S b/lib/csu/i386-elf/crti.S
index b2e99e4..bb11f3a 100644
--- a/lib/csu/i386-elf/crti.S
+++ b/lib/csu/i386-elf/crti.S
@@ -28,12 +28,14 @@
.globl _init
.type _init,@function
_init:
+ sub $12,%esp /* re-align stack pointer */
.section .fini,"ax",@progbits
.align 4
.globl _fini
.type _fini,@function
_fini:
+ sub $12,%esp /* re-align stack pointer */
.section .rodata
.ascii "$FreeBSD$\0"
diff --git a/lib/csu/i386-elf/crtn.S b/lib/csu/i386-elf/crtn.S
index b2322da..bc90d31 100644
--- a/lib/csu/i386-elf/crtn.S
+++ b/lib/csu/i386-elf/crtn.S
@@ -24,9 +24,11 @@
*/
.section .init,"ax",@progbits
+ add $12,%esp
ret
.section .fini,"ax",@progbits
+ add $12,%esp
ret
.section .rodata
OpenPOWER on IntegriCloud