Don't clobber esp
Including esp in the clobbers list is deprecated and
can silently trigger code generation errors (observed
with Android ndk r20 clang).
Fortunately, all the asm templates properly restore
esp, so there's no need to include it in clobbers.
Also add some tests for sys_rt_sigaction.
Bug: https://gcc.gnu.org/PR52813
Bug: crashpad:265
Change-Id: I8317202c115c28ce49a0cb05949babc43b90a274
Reviewed-on: https://chromium-review.googlesource.com/c/linux-syscall-support/+/2151097
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/linux_syscall_support.h b/linux_syscall_support.h
index a177cfb..a087903 100644
--- a/linux_syscall_support.h
+++ b/linux_syscall_support.h
@@ -1962,7 +1962,7 @@
LSS_ENTRYPOINT \
"pop %%ebx" \
args \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res)
#undef _syscall0
#define _syscall0(type,name) \
@@ -2019,7 +2019,7 @@
: "i" (__NR_##name), "ri" ((long)(arg1)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
#undef _syscall6
@@ -2041,7 +2041,7 @@
: "i" (__NR_##name), "0" ((long)(&__s)), \
"c" ((long)(arg2)), "d" ((long)(arg3)), \
"S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
+ : "memory"); \
LSS_RETURN(type,__res); \
}
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
@@ -2127,7 +2127,7 @@
: "0"(-EINVAL), "i"(__NR_clone),
"m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
"m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
- : "esp", "memory", "ecx", "edx", "esi", "edi");
+ : "memory", "ecx", "edx", "esi", "edi");
LSS_RETURN(int, __res);
}