Commit becd754434173032f426d22ffcbfe24f55b3c137

Mark Kettenis 2013-11-06T06:43:49

Align the stack pointer to 16-bytes.

diff --git a/ChangeLog b/ChangeLog
index 29a4dba..43e1fc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-06  Mark Kettenis  <kettenis@gnu.org>
+
+	* src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to
+        16-bytes.
+
 2013-11-06  Konstantin Belousov <kib@freebsd.org>
 
 	* src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler
diff --git a/src/x86/freebsd.S b/src/x86/freebsd.S
index 504349a..97e0b4e 100644
--- a/src/x86/freebsd.S
+++ b/src/x86/freebsd.S
@@ -49,6 +49,9 @@ ffi_call_SYSV:
 	movl  16(%ebp),%ecx
 	subl  %ecx,%esp
 
+	/* Align the stack pointer to 16-bytes */
+	andl  $0xfffffff0, %esp
+
 	movl  %esp,%eax
 
 	/* Place all of the ffi_prep_args in position  */