From e643b202e656c0598b61266c89bef0e17931d1b5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 26 Jul 2008 08:32:28 +0000 Subject: [PATCH] * dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1 only in non-dynamically loaded case. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/dcrt0.cc | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ce3554ef6..244da549e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2008-07-25 Corinna Vinschen + + * dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1 + only in non-dynamically loaded case. + 2008-07-25 Corinna Vinschen * dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1 diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 5fbf2df05..5c85eb834 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -777,7 +777,13 @@ void dll_crt0_1 (void *) { check_sanity_and_sync (user_data); - malloc_init (); + + if (!dynamically_loaded) + { + malloc_init (); + user_shared_initialize_1 (); + } + #ifdef CGF int i = 0; const int n = 2 * 1024 * 1024; @@ -788,8 +794,6 @@ dll_crt0_1 (void *) ProtectHandle (hMainProc); ProtectHandle (hMainThread); - user_shared_initialize_1 (); - cygheap->cwd.init (); /* Initialize pthread mainthread when not forked and it is safe to call new,