From 5f9316981a7df426730026dfd0eea55303133594 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 12 Jul 2000 04:49:07 +0000 Subject: [PATCH] * debug.cc (thread_stub): Use impure_ptr in place of reent_data. * dll_init.cc (dll_dllcrt0): Replace erroneous use of local symbol with correct __cygwin_user_data->impure_ptr. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/debug.cc | 2 +- winsup/cygwin/dll_init.cc | 19 ++----------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 05c2223ad..82d841125 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Wed Jul 12 00:46:00 2000 Christopher Faylor + + * debug.cc (thread_stub): Use impure_ptr in place of reent_data. + * dll_init.cc (dll_dllcrt0): Replace erroneous use of local symbol with + correct __cygwin_user_data->impure_ptr. + Wed Jul 12 00:01:03 2000 Christopher Faylor * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Don't reset diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc index 509f98d91..23cd83cba 100644 --- a/winsup/cygwin/debug.cc +++ b/winsup/cygwin/debug.cc @@ -87,7 +87,7 @@ thread_stub (VOID *arg) SIGSEGV or SIGFPE. */ init_exceptions (&except_entry); - set_reent (&reent_data); + set_reent (user_data->impure_ptr); ExitThread (threadfunc (threadarg)); } diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 38867e18a..0bf405fa4 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -138,8 +138,6 @@ add (HMODULE h, char *name, per_process *p, dllType type) static int initOneDll (per_process *p) { - /* global variable user_data must be initialized */ - /* FIXME: init environment (useful?) */ *(p->envptr) = *(user_data->envptr); @@ -439,26 +437,13 @@ LoadedDllIterator::~LoadedDllIterator () { } -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// the extern symbols - -extern "C" -{ - /* This is an exported copy of environ which can be used by DLLs - which use cygwin.dll. */ - extern struct _reent reent_data; -}; - -extern "C" -int +extern "C" int dll_dllcrt0 (HMODULE h, per_process *p) { - struct _reent reent_data; if (p == NULL) p = &__cygwin_user_data; else - *(p->impure_ptr_ptr) = &reent_data; + *(p->impure_ptr_ptr) = __cygwin_user_data.impure_ptr; /* Partially initialize Cygwin guts for non-cygwin apps. */ if (dynamically_loaded && user_data->magic_biscuit == 0)