aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index d7fde39311..17f2ca919f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -88,14 +88,18 @@
movq errno@GOTTPOFF(%rip), %rcx; \
xorq %rdx, %rdx; \
subq %rax, %rdx; \
- movl %eax, %fs:0(%rcx);
+ movl %edx, %fs:(%rcx); \
+ orq $-1, %rax; \
+ jmp L(pseudo_end);
#elif RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
0: \
leaq errno(%rip), %rcx; \
xorq %rdx, %rdx; \
subq %rax, %rdx; \
- movl %eax, (%rcx);
+ movl %edx, (%rcx); \
+ orq $-1, %rax; \
+ jmp L(pseudo_end);
#elif defined _LIBC_REENTRANT
/* Store (- %rax) into errno through the GOT.
Note that errno occupies only 4 bytes. */