This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Inline asm function calls + red zone
- From: Jason Garrett-Glaser <jason at x264 dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 15 Nov 2011 13:04:57 -0800
- Subject: Inline asm function calls + red zone
>From talking with others, there appears to be a problem with function
calls in inline asm on x86_64: the call clobbers the first 8 bytes of
the stack red zone, which GCC is allowed to use for other data in the
function. This is a problem even if the function being called doesn't
use the stack, because "call" itself does use the stack. Besides the
extremely hacky sequence of:
sub esp, 128
call func
add esp, 128
Is there a way to tell gcc not to use the red zone in a function, or
that part of the red zone is going to be clobbered by the inline
assembly code?
Jason