On Sun, Mar 20, 2022 at 5:33 PM Alviro Iskandar Setiawan wrote:[...]
I don't think you can safely use redzone from inline Assembly. The
compiler may also use redzone for a leaf function. In case the syscall
is done at the same time, your %ebp saving will clobber the redzone
that the compiler uses.
-4(%esp) may be used by the compiler on a leaf call, you can't clobber that.
Using xchgl to preserve %ebp in the same place where the arg6 is
stored in memory is a better solution and doesn't clobber anything.
xchgl %ebp, %[arg6]
int $0x80
xchgl %ebp, %[arg6]