diff options
author | Christopher Faylor <me@cgf.cx> | 2006-05-16 03:14:24 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-05-16 03:14:24 +0000 |
commit | 562adf789066f0bbcd2999944a2648b42e8e8df9 (patch) | |
tree | 4f94240c4750774b1d4c0ac8dab6e5766e19859d /winsup/cygwin/init.cc | |
parent | a9e36321fda82e1f565f2291a2fc4eaf97de4fc6 (diff) | |
download | cygnal-562adf789066f0bbcd2999944a2648b42e8e8df9.tar.gz cygnal-562adf789066f0bbcd2999944a2648b42e8e8df9.tar.bz2 cygnal-562adf789066f0bbcd2999944a2648b42e8e8df9.zip |
* sigproc.cc (no_signals_available): Detect hwait_sig == INVALID_HANDLE_VALUE.
(wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
* cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and no more.
* cygtls.h (_my_tls::padding): Delete.
(CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the end of the
stack.
* dcrt0.cc (initialize_main_tls): Change return to void.
* gentls_offsets: Treat const specially, too. Keep going after a '}' is found.
Change negative offset calculation to use CYGTLS_PADSIZE.
* init.cc (_my_oldfunc): New variable.
(threadfunc_fe): Use stored tls value for oldfunc rather than blindly writing
to the stack.
(munge_threadfunc): Set oldfunc in tls.
(dll_entry): Initialize tls allocation.
* tlsoffsets.h: Regenerate.
Diffstat (limited to 'winsup/cygwin/init.cc')
-rw-r--r-- | winsup/cygwin/init.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index f8b6cd652..f73be7236 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -18,6 +18,8 @@ details. */ #include <ntdef.h> #include "ntdll.h" +static DWORD _my_oldfunc; + int NO_COPY dynamically_loaded; static char NO_COPY *search_for = (char *) cygthread::stub; unsigned threadfunc_ix[8] __attribute__((section (".cygwin_dll_common"), shared)); @@ -30,7 +32,7 @@ threadfunc_fe (VOID *arg) { (void)__builtin_return_address(1); asm volatile ("andl $-16,%%esp" ::: "%esp"); - _cygtls::call ((DWORD (*) (void *, void *)) (((char **) _tlsbase)[OLDFUNC_OFFSET]), arg); + _cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg); } /* If possible, redirect the thread entry point to a cygwin routine which @@ -62,7 +64,7 @@ munge_threadfunc () search_for = NULL; for (i = 0; threadfunc_ix[i]; i++) ebp[threadfunc_ix[i]] = (char *) threadfunc_fe; - ((char **) _tlsbase)[OLDFUNC_OFFSET] = threadfunc; + TlsSetValue (_my_oldfunc, threadfunc); } } } @@ -145,6 +147,7 @@ dll_entry (HANDLE h, DWORD reason, void *static_load) respawn_wow64_process (); dll_crt0_0 (); + _my_oldfunc = TlsAlloc (); break; case DLL_PROCESS_DETACH: break; |