aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2021-05-20 11:00:36 -0300
committerMatheus Castanho <msc@linux.ibm.com>2021-05-24 17:01:40 -0300
commit7de36744ee1325f35d3fe0ca079dd33c40b12267 (patch)
treebd0e5c1b564964f1922aab977f907b801319ecb5 /sysdeps
parent79aec841029c160a85f46564f8bad132af008e30 (diff)
downloadglibc-7de36744ee1325f35d3fe0ca079dd33c40b12267.zip
glibc-7de36744ee1325f35d3fe0ca079dd33c40b12267.tar.gz
glibc-7de36744ee1325f35d3fe0ca079dd33c40b12267.tar.bz2
powerpc: Fix handling of scv return error codes [BZ #27892]
When using scv for templated ASM syscalls, current code interprets any negative return value as error, but the only valid error codes are in the range -4095..-1 according to the ABI. This commit also fixes 'signal.gen.test' strace test, where the issue was first identified. Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc64/sysdep.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index c57bb1c..1ea4c3b 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -398,8 +398,9 @@ LT_LABELSUFFIX(name,_name_end): ; \
#endif
#define RET_SCV \
- cmpdi r3,0; \
- bgelr+; \
+ li r9,-4095; \
+ cmpld r3,r9; \
+ bltlr+; \
neg r3,r3;
#define RET_SC \