Re: i386 ABI and the stack

From: H. Peter Anvin
Date: Fri Jun 23 2006 - 21:58:20 EST


Linus Torvalds wrote:

We always have. It's the x86 ABI.

The x86-64 ABI has a 128-byte(*) zone that is safe from signals etc, so you can use a small amount of stack below the stackpointer safely. Not so on x86.

Linus

(*) That "128 byte" is from memory. Maybe it's bigger.

Adding a small redzone like this to i386 would be easy, though -- just drop the stack pointer by that much when creating a signal frame. 128 bytes isn't enough to interfere with libraries.

Unlike other enhancements that have been proposed to the i386 ABI (like regparm), this has the advantage of being fully backwards-compatible with old binaries and libraries. As long as you have a kernel that knows to preserve the redzone, then you can use the new -mredzone option, but you cross-call classical ABI functions without any problems, and old ABI programs won't even notice.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/