diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-12-23 12:00:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-12-23 12:00:49 +0000 |
commit | d455df776c9188ee1d5290b44d1f427e61e8a9a8 (patch) | |
tree | 58343a98e476646f8d1f47684ffee961e4a153e0 /lib/csu | |
parent | 385adeaba7f23ec8bf86636c98aa15245cc09a74 (diff) |
Explicitly align the stack on a 16-byte boundary such that constructors can
use SSE instructions. In principle we should be able to rely on the stack to
be aligned properly, but the i386 calling convention makes this rather fragile.
ok guenther@, deraadt@
Diffstat (limited to 'lib/csu')
-rw-r--r-- | lib/csu/i386/md_init.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/csu/i386/md_init.h b/lib/csu/i386/md_init.h index ccd5bd376ef..5423e02ecd9 100644 --- a/lib/csu/i386/md_init.h +++ b/lib/csu/i386/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.2 2011/03/31 09:48:09 kettenis Exp $ */ +/* $OpenBSD: md_init.h,v 1.3 2012/12/23 12:00:48 kettenis Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -50,13 +50,15 @@ " .type " #entry_pt ",@function \n" \ #entry_pt": \n" \ " .align 16 \n" \ - " subl $8,%esp \n" \ + " pushl %ebp \n" \ + " movl %esp,%ebp \n" \ + " andl $~15,%esp \n" \ " .previous") #define MD_SECTION_EPILOGUE(sect) \ __asm ( \ ".section "#sect",\"ax\",@progbits \n" \ - " addl $8,%esp \n" \ + " leave \n" \ " ret \n" \ " .previous") |