summaryrefslogtreecommitdiffstats
path: root/lib/csu
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2005-05-19 07:36:07 +0000
committerdfr <dfr@FreeBSD.org>2005-05-19 07:36:07 +0000
commit62b7d28467589faf0802ddb4e3d431b8bbf1f6f2 (patch)
tree94bc52cb93334906253b5ede919f2c252a41e61e /lib/csu
parent46ba1c3d373e6e1207a49bb8a190091eb180ee9f (diff)
downloadFreeBSD-src-62b7d28467589faf0802ddb4e3d431b8bbf1f6f2.zip
FreeBSD-src-62b7d28467589faf0802ddb4e3d431b8bbf1f6f2.tar.gz
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
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/i386-elf/crt1.c3
1 files changed, 3 insertions, 0 deletions
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 = &ap;
argc = *(long *)(void *)(argv - 1);
OpenPOWER on IntegriCloud