From a0780919b48b7b966822f3513edd6cf131ad3d8d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 20 Sep 1998 09:48:01 +0000 Subject: Update. 1998-09-20 09:37 Ulrich Drepper * elf/Versions [GLIBC_2.1] (libc): Add __fpu_control. * elf/elf.h: Add AT_FPUCW. * elf/Makefile (dl-routines): Add fpu_control. (elide-routines.os): Add fpu_control. (rtld-routines): Add fpu_control. * math/Makefile (aux): Remove fpu_control. * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Handle AT_FPUCW. (_dl_show_auxv): Likewise. * sysdeps/unix/sysv/linux/init-first.c (init): Use __setfpucw only if different from OS default. * stdio-common/tstscanf.c: Add test case for (nil). --- sysdeps/generic/dl-sysdep.c | 10 ++++++++++ sysdeps/unix/sysv/linux/init-first.c | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c index 15f85550fe..120f362e75 100644 --- a/sysdeps/generic/dl-sysdep.c +++ b/sysdeps/generic/dl-sysdep.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -126,6 +127,9 @@ _dl_sysdep_start (void **start_argptr, case AT_HWCAP: _dl_hwcap = av->a_un.a_val; break; + case AT_FPUCW: + __fpu_control = av->a_un.a_val; + break; } /* Linux doesn't provide us with any of these values on the stack @@ -249,6 +253,12 @@ _dl_show_auxv (void) 16, 0), "\n", NULL); break; + case AT_FPUCW: + _dl_sysdep_message ("AT_FPUCW: ", + _itoa_word (av->a_un.a_val, buf + sizeof buf - 1, + 10, 0), + "\n", NULL); + break; } } diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c index 0931e99113..4b7af46d78 100644 --- a/sysdeps/unix/sysv/linux/init-first.c +++ b/sysdeps/unix/sysv/linux/init-first.c @@ -60,8 +60,10 @@ init (int argc, char **argv, char **envp) the executable format. */ __personality (PER_LINUX); - /* Set the FPU control word to the proper default value. */ - __setfpucw (__fpu_control); + /* Set the FPU control word to the proper default value if the + kernel would use a different value. */ + if (__fpu_control != _FPU_DEFAULT) + __setfpucw (__fpu_control); } /* Save the command-line arguments. */ -- cgit v1.2.3