From e6963ec512a47d09e5f7ae62feb3ab7786a89598 Mon Sep 17 00:00:00 2001 From: dfr Date: Thu, 19 May 2005 07:31:06 +0000 Subject: 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 --- lib/csu/i386-elf/crti.S | 2 ++ lib/csu/i386-elf/crtn.S | 2 ++ 2 files changed, 4 insertions(+) (limited to 'lib/csu') 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 -- cgit v1.1