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
This commit is contained in:
Doug Rabson 2005-05-19 07:31:06 +00:00
parent a9f9f6ce08
commit 0ff6455012
2 changed files with 4 additions and 0 deletions

View File

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

View File

@ -24,9 +24,11 @@
*/
.section .init,"ax",@progbits
add $12,%esp
ret
.section .fini,"ax",@progbits
add $12,%esp
ret
.section .rodata