]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
AArch64: Fix handling of nocancel syscall failures
authorWill Newton <will.newton@linaro.org>
Mon, 19 May 2014 13:38:30 +0000 (14:38 +0100)
committerWill Newton <will.newton@linaro.org>
Tue, 20 May 2014 12:48:23 +0000 (13:48 +0100)
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.

ChangeLog
sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h

index 8c2fd9752e0a66890feebf22b32d7283415b9432..fc75ff2d1c074447b5847a7c7bf5409b30ccd29f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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>
 
index f6903b5dd8ca2c381d707298626ea1659c575c35..0e9bef3afc39cc79a3c608f4591610ce074b6e4f 100644 (file)
@@ -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;   \