public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix stack alignment on *BSD/i386
@ 2013-04-01 11:18 Mark Kettenis
  2013-11-04 23:47 ` Brad Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2013-04-01 11:18 UTC (permalink / raw)
  To: libffi-discuss

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.


2013-04-01  Mark Kettenis  <kettenis@gnu.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  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix stack alignment on *BSD/i386
  2013-04-01 11:18 [PATCH] Fix stack alignment on *BSD/i386 Mark Kettenis
@ 2013-11-04 23:47 ` Brad Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Brad Smith @ 2013-11-04 23:47 UTC (permalink / raw)
  To: libffi-discuss

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-04 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-01 11:18 [PATCH] Fix stack alignment on *BSD/i386 Mark Kettenis
2013-11-04 23:47 ` Brad Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).