* dlfcn.cc (dlopen): Disable old 32 bit code on 64 bit.
* dcrt0.cc (check_sanity_and_sync): Ditto. * dll_init.cc (dll_dllcrt0_1): Fix typo in comment.
This commit is contained in:
parent
7a84e9c4bc
commit
3ab591cf71
@ -1,3 +1,9 @@
|
|||||||
|
2014-10-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* dlfcn.cc (dlopen): Disable old 32 bit code on 64 bit.
|
||||||
|
* dcrt0.cc (check_sanity_and_sync): Ditto.
|
||||||
|
* dll_init.cc (dll_dllcrt0_1): Fix typo in comment.
|
||||||
|
|
||||||
2014-10-09 Corinna Vinschen <corinna@vinschen.de>
|
2014-10-09 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_procsys.cc (fhandler_procsys::readdir): Just test
|
* fhandler_procsys.cc (fhandler_procsys::readdir): Just test
|
||||||
|
@ -393,11 +393,13 @@ check_sanity_and_sync (per_process *p)
|
|||||||
api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %u > %u",
|
api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %u > %u",
|
||||||
p->api_major, cygwin_version.api_major);
|
p->api_major, cygwin_version.api_major);
|
||||||
|
|
||||||
|
#ifndef __x86_64__
|
||||||
/* This is a kludge to work around a version of _cygwin_common_crt0
|
/* This is a kludge to work around a version of _cygwin_common_crt0
|
||||||
which overwrote the cxx_malloc field with the local DLL copy.
|
which overwrote the cxx_malloc field with the local DLL copy.
|
||||||
Hilarity ensues if the DLL is not loaded while the process
|
Hilarity ensues if the DLL is not loaded while the process
|
||||||
is forking. */
|
is forking. */
|
||||||
__cygwin_user_data.cxx_malloc = &default_cygwin_cxx_malloc;
|
__cygwin_user_data.cxx_malloc = &default_cygwin_cxx_malloc;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
child_info NO_COPY *child_proc_info;
|
child_info NO_COPY *child_proc_info;
|
||||||
|
@ -135,6 +135,7 @@ dlopen (const char *name, int flags)
|
|||||||
if (last_bs && !wcschr (last_bs, L'.'))
|
if (last_bs && !wcschr (last_bs, L'.'))
|
||||||
wcscat (last_bs, L".");
|
wcscat (last_bs, L".");
|
||||||
|
|
||||||
|
#ifndef __x86_64__
|
||||||
/* Workaround for broken DLLs built against Cygwin versions 1.7.0-49
|
/* Workaround for broken DLLs built against Cygwin versions 1.7.0-49
|
||||||
up to 1.7.0-57. They override the cxx_malloc pointer in their
|
up to 1.7.0-57. They override the cxx_malloc pointer in their
|
||||||
DLL initialization code even if loaded dynamically. This is a
|
DLL initialization code even if loaded dynamically. This is a
|
||||||
@ -150,6 +151,7 @@ dlopen (const char *name, int flags)
|
|||||||
/* Store original cxx_malloc pointer. */
|
/* Store original cxx_malloc pointer. */
|
||||||
struct per_process_cxx_malloc *tmp_malloc;
|
struct per_process_cxx_malloc *tmp_malloc;
|
||||||
tmp_malloc = __cygwin_user_data.cxx_malloc;
|
tmp_malloc = __cygwin_user_data.cxx_malloc;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(flags & RTLD_NOLOAD)
|
if (!(flags & RTLD_NOLOAD)
|
||||||
|| (ret = GetModuleHandleW (path)) != NULL)
|
|| (ret = GetModuleHandleW (path)) != NULL)
|
||||||
@ -160,8 +162,10 @@ dlopen (const char *name, int flags)
|
|||||||
(HMODULE *) &ret);
|
(HMODULE *) &ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __x86_64__
|
||||||
/* Restore original cxx_malloc pointer. */
|
/* Restore original cxx_malloc pointer. */
|
||||||
__cygwin_user_data.cxx_malloc = tmp_malloc;
|
__cygwin_user_data.cxx_malloc = tmp_malloc;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
__seterrno ();
|
__seterrno ();
|
||||||
|
@ -640,7 +640,7 @@ dll_dllcrt0_1 (VOID *x)
|
|||||||
when loaded either statically or dynamically. Because this leaves
|
when loaded either statically or dynamically. Because this leaves
|
||||||
a stale pointer into demapped memory space if the DLL is unloaded
|
a stale pointer into demapped memory space if the DLL is unloaded
|
||||||
by a call to dlclose, we prevent this happening for dynamically
|
by a call to dlclose, we prevent this happening for dynamically
|
||||||
loaded DLLS in dlopen by saving and restoring cxx_malloc around
|
loaded DLLs in dlopen by saving and restoring cxx_malloc around
|
||||||
the call to LoadLibrary, which invokes the DLL's startup sequence.
|
the call to LoadLibrary, which invokes the DLL's startup sequence.
|
||||||
Modern DLLs won't even attempt to override the pointer when loaded
|
Modern DLLs won't even attempt to override the pointer when loaded
|
||||||
statically, but will write their overrides directly into the
|
statically, but will write their overrides directly into the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user