summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc47
1 files changed, 1 insertions, 46 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index fda4b58b8..822e36e62 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -35,7 +35,6 @@ details. */
#include "cygxdr.h"
#include "fenv.h"
#include "ntdll.h"
-#include "wow64.h"
#define MAX_AT_FILE_LEVEL 10
@@ -406,18 +405,8 @@ child_info NO_COPY *child_proc_info;
void
child_info_fork::alloc_stack ()
{
- /* Make sure not to try a hard allocation if we have been forked off from
- the main thread of a Cygwin process which has been started from a 64 bit
- parent. In that case the StackBase of the forked child is not the same
- as the StackBase of the parent (== this.stackbase), but only because the
- stack of the parent has been slightly rearranged. See comment in
- wow64_revert_to_original_stack for details. We check here if the
- parent stack fits into the child stack. */
PTEB teb = NtCurrentTeb ();
- if (teb->Tib.StackBase != stackbase
- && (!wincap.is_wow64 ()
- || stacklimit < teb->DeallocationStack
- || stackbase > teb->Tib.StackBase))
+ if (teb->Tib.StackBase != stackbase)
{
void *stack_ptr;
size_t stacksize;
@@ -772,14 +761,6 @@ dll_crt0_0 ()
{
setup_cygheap ();
memory_init ();
-#ifndef __x86_64__
- /* WOW64 process on XP/64 or Server 2003/64? Check if we have been
- started from 64 bit process and if our stack is at an unusual
- address. Set wow64_needs_stack_adjustment if so. Problem
- description in wow64_test_for_64bit_parent. */
- if (wincap.wow64_has_secondary_stack ())
- wow64_needs_stack_adjustment = wow64_test_for_64bit_parent ();
-#endif /* !__x86_64__ */
}
else
{
@@ -1091,32 +1072,6 @@ _dll_crt0 ()
fork_info->alloc_stack ();
}
#else
- /* Handle WOW64 process on XP/2K3 which has been started from native 64 bit
- process. See comment in wow64_test_for_64bit_parent for a full problem
- description. */
- if (wow64_needs_stack_adjustment && !dynamically_loaded)
- {
- /* Must be static since it's referenced after the stack and frame
- pointer registers have been changed. */
- static PVOID allocationbase;
-
- PVOID stackaddr = wow64_revert_to_original_stack (allocationbase);
- if (stackaddr)
- {
- /* Set stack pointer to new address. Set frame pointer to 0. */
- __asm__ ("\n\
- movl %[ADDR], %%esp \n\
- xorl %%ebp, %%ebp \n"
- : : [ADDR] "r" (stackaddr));
- /* We're back on the original stack now. Free up space taken by the
- former main thread stack and set DeallocationStack correctly. */
- VirtualFree (NtCurrentTeb ()->DeallocationStack, 0, MEM_RELEASE);
- NtCurrentTeb ()->DeallocationStack = allocationbase;
- }
- else
- /* Fall back to respawning if creating a new stack fails. */
- wow64_respawn_process ();
- }
main_environ = user_data->envptr;
if (in_forkee)
fork_info->alloc_stack ();