about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-04-18 02:51:26 +0100
committerPetr Baudis <pasky@ucw.cz>2011-05-27 00:34:37 +0200
commit8277fdc1cd54428e54e112db7f5be89303951001 (patch)
treec57104842eda4298e94781c1c033823f120b0075 /sysdeps/unix
parentfea332e16416691310088b5c0e6797694c88352b (diff)
downloadglibc-8277fdc1cd54428e54e112db7f5be89303951001.tar.gz
glibc-8277fdc1cd54428e54e112db7f5be89303951001.tar.xz
glibc-8277fdc1cd54428e54e112db7f5be89303951001.zip
Fix FPU context handling in getcontext on x86-64.
fnstenv on x86-64 seems to clear the state.  Work around.

(cherry picked from commit 75ea32abcde4e1699328354e1804ea94560d2950)
Diffstat (limited to 'sysdeps/unix')
-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