From 62b7d28467589faf0802ddb4e3d431b8bbf1f6f2 Mon Sep 17 00:00:00 2001 From: dfr Date: Thu, 19 May 2005 07:36:07 +0000 Subject: Align the stack to a 16 byte boundary so that we can safely call functions that use SSE. The compiler does attempt to do this in main() but not very successfully - it still manages to use unaligned offsets from %ebp in some cases. Also we need to have an aligned stack in case something uses SSE via _init(). MFC After: 1 week --- lib/csu/i386-elf/crt1.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/csu') diff --git a/lib/csu/i386-elf/crt1.c b/lib/csu/i386-elf/crt1.c index 9e8acaa..c6774b0 100644 --- a/lib/csu/i386-elf/crt1.c +++ b/lib/csu/i386-elf/crt1.c @@ -78,6 +78,9 @@ _start(char *ap, ...) char **env; const char *s; +#ifdef __GNUC__ + __asm__("and $0xfffffff0,%esp"); +#endif cleanup = get_rtld_cleanup(); argv = ≈ argc = *(long *)(void *)(argv - 1); -- cgit v1.1