diff options
author | Christopher Faylor <me@cgf.cx> | 2006-05-25 06:33:13 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-05-25 06:33:13 +0400 |
commit | 38229bcdcf45221857163f39d865d1d5d113a9b7 (patch) | |
tree | 4a525ef2515e8ce1715ea075e12d34a55c198390 /winsup/cygwin/dcrt0.cc | |
parent | 99fc5e10f338e668b85288366e03727157f23af5 (diff) |
* cygtls.cc (_cygtls::call): Call call2 using _my_tls.
(_cygtls::init_exception_handler): Always replace existing exception handler
with cygwin exception handler.
* cygtls.h (_cygtls::call2): Remove static designation.
* dcrto.cc (dll_crt0_1): Define in a way that allows calling via _cygtls::call.
(_initialize_main_tls): Delete.
(_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here.
* external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE.
* include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define.
* tlsoffsets.h: Regenerate.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 667699dd7..5469e7598 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -784,7 +784,7 @@ dll_crt0_0 () opposed to being link-time loaded by Cygwin apps) from a non cygwin app via LoadLibrary. */ static void -dll_crt0_1 (char *) +dll_crt0_1 (void *, void *) { check_sanity_and_sync (user_data); malloc_init (); @@ -953,37 +953,17 @@ dll_crt0_1 (char *) cygwin_exit (user_data->main (__argc, __argv, *user_data->envptr)); } -static void -initialize_main_tls (char *padding) -{ - if (!_main_tls) - { - _main_tls = &_my_tls; - _main_tls->init_thread (padding, NULL); - } - return; -} - -/* Wrap the real one, otherwise gdb gets confused about - two symbols with the same name, but different addresses. - - UPTR is a pointer to global data that lives on the libc side of the - line [if one distinguishes the application from the dll]. */ - extern "C" void __stdcall _dll_crt0 () { main_environ = user_data->envptr; - - char padding[CYGTLS_PADSIZE]; - if (in_forkee) fork_info->alloc_stack (); else __sinit (_impure_ptr); - initialize_main_tls (padding); - dll_crt0_1 (padding); + _main_tls = &_my_tls; + _main_tls->call ((DWORD (*) (void *, void *)) dll_crt0_1, NULL); } void |