From 12743c2d5d2721f3a80b4d7671a349be03c1f520 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 3 Dec 2015 22:56:44 +0100 Subject: On 64 bit, only create new thread stack if started from 32 bit process on affected platforms * dcrt0.cc (dll_crt0_0): On 64 bit, set wow64_needs_stack_adjustment if not started from a 64 bit process. (_dll_crt0): Enable wow64_needs_stack_adjustment branch on 64 bit as well. Remove 64 bit only code. Introduce CREATE_STACK and FIX_STACK macros to conditionalize the code. Rearrange and partially rewrite comments. * wincap.h (wincaps::has_3264_stack_broken): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Set has_3264_stack_broken to false on 32 bit. * wow64.cc: Enable functionality on 64 bit architecture, except for wow64_revert_to_original_stack. Enhance comments to explain. (wow64_eval_expected_main_stack): Make 64 bit clean. (wow64_test_for_64bit_parent): Ditto. * wow64.h: Export wow64_revert_to_original_stack on 32 bit only, everything else on all architectures. Signed-off-by: Corinna Vinschen --- winsup/cygwin/wow64.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/wow64.h') diff --git a/winsup/cygwin/wow64.h b/winsup/cygwin/wow64.h index a0b5b31..150561c 100644 --- a/winsup/cygwin/wow64.h +++ b/winsup/cygwin/wow64.h @@ -1,6 +1,6 @@ /* wow64.h - Copyright 2011, 2012 Red Hat, Inc. + Copyright 2011, 2012, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -8,14 +8,12 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#ifndef __x86_64__ -/* WOW64 only plays a role in the 32 bit version. Don't use any of this - in the 64 bit version. */ - extern bool NO_COPY wow64_needs_stack_adjustment; - extern bool wow64_test_for_64bit_parent (); -extern PVOID wow64_revert_to_original_stack (PVOID &allocationbase); extern void wow64_respawn_process () __attribute__ ((noreturn)); +#ifndef __x86_64__ + +extern PVOID wow64_revert_to_original_stack (PVOID &allocationbase); + #endif /* !__x86_64__ */ -- cgit v1.1