* dcrt0.cc (dll_crt0_0): Move _main_tls initialization here.

(__dll_crt0): Only initialize _main_tls if it changes.
* fhandler_console.cc (fhandler_console::write): Fix debugging output.
This commit is contained in:
Christopher Faylor
2010-10-02 19:08:21 +00:00
parent 1da77c2678
commit f0b04035b1
3 changed files with 13 additions and 3 deletions

View File

@@ -771,6 +771,8 @@ dll_crt0_0 ()
disable_dep ();
#endif
_main_tls = &_my_tls;
/* Initialize signal processing here, early, in the hopes that the creation
of a thread early in the process will cause more predictability in memory
layout for the main thread. */
@@ -970,9 +972,11 @@ _dll_crt0 ()
{
main_environ = user_data->envptr;
if (in_forkee)
fork_info->alloc_stack ();
{
fork_info->alloc_stack ();
_main_tls = &_my_tls;
}
_main_tls = &_my_tls;
_main_tls->call ((DWORD (*) (void *, void *)) dll_crt0_1, NULL);
}