diff options
author | Christopher Faylor <me@cgf.cx> | 2005-03-03 00:49:53 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-03-03 00:49:53 +0000 |
commit | 608b0ce960f564ab86ebe56b6ea24d063169ee8c (patch) | |
tree | 7595cd7d0b042a77db955d137af7aeff7eba862d /winsup/cygwin/autoload.cc | |
parent | 55b670024ce220b4be27a6f62849aba3204b09f0 (diff) | |
download | cygnal-608b0ce960f564ab86ebe56b6ea24d063169ee8c.tar.gz cygnal-608b0ce960f564ab86ebe56b6ea24d063169ee8c.tar.bz2 cygnal-608b0ce960f564ab86ebe56b6ea24d063169ee8c.zip |
* autoload.cc (std_dll_init): Save and restore fpu control register around
LoadAddress to prevent loaded dlls (like msvcrt.dll) from setting unwanted
stuff.
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r-- | winsup/cygwin/autoload.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 805b765c1..aef122a2f 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -208,8 +208,13 @@ std_dll_init () while (InterlockedIncrement (&dll->here)); else if (!dll->handle) { + unsigned fpu_control = 0; + __asm__ __volatile__ ("fnstcw %0": "=m" (fpu_control)); if ((h = LoadLibrary (dll->name)) != NULL) - dll->handle = h; + { + __asm__ __volatile__ ("fldcw %0": : "m" (fpu_control)); + dll->handle = h; + } else if (!(func->decoration & 1)) api_fatal ("could not load %s, %E", dll->name); else @@ -256,7 +261,6 @@ wsock_init () if (!wsock_started) { - /* Don't use autoload to load WSAStartup to eliminate recursion. */ int (*wsastartup) (int, WSADATA *); wsastartup = (int (*)(int, WSADATA *)) |