[LibOS/glibc] Don't ignore redzone in syscall-template.S

For trivial system call, sysdeps/unix/syscall-template.S is used to generate system call stub functions, which ignores redzone.
This commit fixes the issue.
Also use %rcx instead of %rbx without pushq/popq as %rcx is clobbered in system call ABI.

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
This commit is contained in:
Isaku Yamahata
2019-02-11 17:38:36 -05:00
committed by Don Porter
parent 8cb262d0c0
commit 7dae9d6460
+11 -6
View File
@@ -5,12 +5,17 @@
.weak syscalldb
.type syscalldb, @function
# define SYSCALLDB \
pushq %rbx; \
movq syscalldb@GOTPCREL(%rip), %rbx; \
call *%rbx; \
popq %rbx;
# if defined(PSEUDO) && defined(SYSCALL_NAME) && defined(SYSCALL_SYMBOL)
# define SYSCALLDB \
subq $128, %rsp; \
movq syscalldb@GOTPCREL(%rip), %rcx; \
call *%rcx; \
addq $128, %rsp
# else
# define SYSCALLDB \
movq syscalldb@GOTPCREL(%rip), %rcx; \
call *%rcx
# endif
#else /* !__ASSEMBLER__ */
asm (