summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-09-30 07:09:42 +0000
committerAndreas Jaeger <aj@suse.de>2002-09-30 07:09:42 +0000
commitf6c1008561bc9590bac9b1f79b8e50f62ed8f462 (patch)
tree97f9eacff839270f3b79a5c3a51b4b0b86444895
parent6ebd24ad98d5cfe6f383267cb98f6a084f30910b (diff)
downloadglibc-f6c1008561bc9590bac9b1f79b8e50f62ed8f462.tar.gz
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER):
Store 4 bytes into errno, not 8 bytes. * sysdeps/unix/x86_64/sysdep.S: Store 32 bits at errno, not 64 bits. AFAICT, it was just blind luck that the word following errno in .bss was just alignment padding and not some other variable to be clobbered.
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h8
-rw-r--r--sysdeps/unix/x86_64/sysdep.S8
2 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 972fa20442..2b11d37ee3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -73,7 +73,7 @@
#ifndef PIC
#define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
#else
-/* Store (- %rax) into errno through the GOT. */
+/* Store (- %rax) into errno through the GOT. Note that errno occupies 4 bytes. */
#ifdef _LIBC_REENTRANT
#define SYSCALL_ERROR_HANDLER \
0: \
@@ -84,7 +84,7 @@
call BP_SYM (__errno_location)@PLT; \
POP_ERRNO_LOCATION_RETURN; \
popq %rdx; \
- movq %rdx, (%rax); \
+ movl %edx, (%rax); \
orq $-1, %rax; \
jmp L(pseudo_end);
@@ -95,7 +95,7 @@
0:movq errno@GOTPCREL(%RIP), %rcx; \
xorq %rdx, %rdx; \
subq %rax, %rdx; \
- movq %rdx, (%rcx); \
+ movl %edx, (%rcx); \
orq $-1, %rax; \
jmp L(pseudo_end);
#endif /* _LIBC_REENTRANT */
diff --git a/sysdeps/unix/x86_64/sysdep.S b/sysdeps/unix/x86_64/sysdep.S
index b26b1db934..e7865914e1 100644
--- a/sysdeps/unix/x86_64/sysdep.S
+++ b/sysdeps/unix/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,19 +49,19 @@ notb:
call BP_SYM (__errno_location)
POP_ERRNO_LOCATION_RETURN
popq %rcx
- movq %rcx, (%rax)
+ movl %ecx, (%rax)
# endif
#else
# ifndef _LIBC_REENTRANT
movq C_SYMBOL_NAME(errno)@GOTPCREL(%rip), %rcx
- movq %rax, (%rcx)
+ movl %eax, (%rcx)
# else
pushq %rax
PUSH_ERRNO_LOCATION_RETURN
call C_SYMBOL_NAME (BP_SYM (__errno_location)@PLT)
POP_ERRNO_LOCATION_RETURN
popq %rcx
- movq %rcx, (%rax)
+ movl %ecx, (%rax)
# endif
#endif
movq $-1, %rax