This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH] Fix stack alignment on *BSD/i386
- From: Brad Smith <brad at comstyle dot com>
- To: libffi-discuss at sourceware dot org
- Date: Mon, 04 Nov 2013 18:43:55 -0500
- Subject: Re: [PATCH] Fix stack alignment on *BSD/i386
- Authentication-results: sourceware.org; auth=none
- References: <201304011118 dot r31BI5OV023760 at glazunov dot sibelius dot xs4all dot nl>
On 01/04/13 7:18 AM, Mark Kettenis wrote:
The same thing was done to the "generic" SystemV ABI code back in
2010. Without this, executing code that uses SSE instructions with
data on the stack will fail.
ping.
2013-04-01 Mark Kettenis <kettenis-mXXj517/zsQ@public.gmane.org>
* src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to
16-bytes.
Index: src/x86/freebsd.S
===================================================================
--- src/x86/freebsd.S (revision 197303)
+++ src/x86/freebsd.S (working copy)
@@ -49,6 +49,9 @@
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 */
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.