]> sourceware.org Git - newlib-cygwin.git/commitdiff
* autoload.cc (std_dll_init): Save and restore fpu control register around
authorChristopher Faylor <me@cgf.cx>
Thu, 3 Mar 2005 00:49:53 +0000 (00:49 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 3 Mar 2005 00:49:53 +0000 (00:49 +0000)
LoadAddress to prevent loaded dlls (like msvcrt.dll) from setting unwanted
stuff.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc

index 3e8218771d435f8eee2e0abe52095e5eb1bd5364..302fb5ef0f3bb7f2edb3d0ee720ce6fb24865f14 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-02  Christopher Faylor  <cgf@timesys.com>
+
+       * autoload.cc (std_dll_init): Save and restore fpu control register
+       around LoadAddress to prevent loaded dlls (like msvcrt.dll) from
+       setting unwanted stuff.
+
 2005-03-02  Christopher Faylor  <cgf@timesys.com>
 
        * cygtls.cc (_cygtls::init_thread): Move exitsock setting later.  It
index 805b765c1bd2bc35581f718683f63dfa56de4eaf..aef122a2fbf3bf01ee104372e8561ddef2b0de43 100644 (file)
@@ -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 *))
This page took 0.034639 seconds and 5 git commands to generate.