about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-04-17 21:51:26 -0400
committerUlrich Drepper <drepper@gmail.com>2011-04-17 21:51:26 -0400
commit75ea32abcde4e1699328354e1804ea94560d2950 (patch)
treee8a166eed29a24667460a4759ac4ae84fe95c3a6 /sysdeps
parent94409c736b216c405c214c041a33b5fab58bd408 (diff)
downloadglibc-75ea32abcde4e1699328354e1804ea94560d2950.tar.gz
glibc-75ea32abcde4e1699328354e1804ea94560d2950.tar.xz
glibc-75ea32abcde4e1699328354e1804ea94560d2950.zip
Fix FPU context handling in getcontext on x86-64.
fnstenv on x86-64 seems to clear the state.  Work around.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/getcontext.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
index 4bbc7a4d2e..1a31d72dad 100644
--- a/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
@@ -1,5 +1,5 @@
 /* Save current context.
-   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
 
@@ -62,6 +62,7 @@ ENTRY(__getcontext)
 	movq	%rcx, oFPREGS(%rdi)
 	/* Save the floating-point environment.  */
 	fnstenv	(%rcx)
+	fldenv	(%rcx)
 	stmxcsr oMXCSR(%rdi)
 
 	/* Save the current signal mask with