about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h10
2 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f1921def94..200c726994 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-05-22  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_SET_ERRNO):
+	Use "neg %eax".
+
 	* sysdeps/unix/sysv/linux/bits/resource.h (RLIM_INFINITY): Use
 	__rlim_t cast.
 	(struct rusage): Use anonymous union to pad each field to
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 3f5bdd2ac3..396345e8b7 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -115,9 +115,8 @@
 # if defined PIC && defined RTLD_PRIVATE_ERRNO
 #  define SYSCALL_SET_ERRNO			\
   lea rtld_errno(%rip), %RCX_LP;		\
-  xorl %edx, %edx;				\
-  sub %RAX_LP, %RDX_LP;				\
-  movl %edx, (%rcx)
+  neg %eax;					\
+  movl %eax, (%rcx)
 # else
 #  ifndef NOT_IN_libc
 #   define SYSCALL_ERROR_ERRNO __libc_errno
@@ -126,9 +125,8 @@
 #  endif
 #  define SYSCALL_SET_ERRNO			\
   movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
-  xorl %edx, %edx;				\
-  sub %RAX_LP, %RDX_LP;				\
-  movl %edx, %fs:(%rcx)
+  neg %eax;					\
+  movl %eax, %fs:(%rcx);
 # endif
 
 # ifndef PIC