summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-05-19 14:38:30 +0100
committerWill Newton <will.newton@linaro.org>2014-06-06 11:53:47 +0100
commit43128471c729a06d902fbe34343ec95d3ccf2ea7 (patch)
treee9fb7b09dd6d84ac3f46169a4fff07815d1f27be
parentd5a18ed19e2f9c2914a26a124e27a8129ba7121d (diff)
AArch64: Fix handling of nocancel syscall failures
The current code for nocancel syscalls does not do a comparison of the system call return value. This leads to code being generated where the b.cs follows the svc instruction directly without setting the flags on which the branch depends. ChangeLog: 2014-05-20 Will Newton <will.newton@linaro.org> * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO): Test the return value of the system call in the nocancel case.
-rw-r--r--libc/ports/ChangeLog.aarch64.linaro5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro
index ff97a9a67..411359d17 100644
--- a/libc/ports/ChangeLog.aarch64.linaro
+++ b/libc/ports/ChangeLog.aarch64.linaro
@@ -1,4 +1,9 @@
2014-05-20 Will Newton <will.newton@linaro.org>
+
+ * sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
+ Test the return value of the system call in the nocancel case.
+
+2014-05-20 Will Newton <will.newton@linaro.org>
Yvan Roux <yvan.roux@linaro.org>
* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused
diff --git a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index f6903b5dd..0e9bef3af 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -32,6 +32,7 @@
__##syscall_name##_nocancel: \
cfi_startproc; \
DO_CALL (syscall_name, args); \
+ cmn x0, 4095; \
PSEUDO_RET; \
cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \