Re: Intel Assembler on OSX?
Re: Intel Assembler on OSX?
- Subject: Re: Intel Assembler on OSX?
- From: Uli Kusterer <email@hidden>
- Date: Sun, 5 Nov 2006 14:21:39 +0100
Am 04.11.2006 um 20:09 schrieb Eric Albert:
On Nov 4, 2006, at 2:01 AM, Uli Kusterer wrote:
So, my app will be launched with a mis-aligned stack? Aha! That
also explains the (seemingly pointless) subl $8, %esp at the start
of even empty functions.
That's not actually necessary, though I can't remember if the
compiler might do it anyway. Since the ABI requirement is just
that the stack be 16-byte aligned at the site of every call
instruction, leaf functions don't need to maintain internal stack
alignment unless it would be useful for their codegen. A leaf
function which doesn't have any SSE/SSE2/SSE3/SSSE3 instructions
doesn't need a 16-byte aligned stack.
Good to know. Though I guess it's easier to write a codegen that
keeps the stack aligned than one that keeps track of alignment and
fixes it as needed...
So, whenever I enter a function, the stack will be at 4 because
the return address has been pushed?
It'll actually be at 0xc -- 4 down from 16.
*mumbles something incomprehensible about upside-down stacks* ;-)
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden