* dcrt0.cc (dll_crt0_0): Check for wincap.wow64_has_secondary_stack

rather than for wincap.is_wow64.  Accommodate name change from
	wow64_has_64bit_parent to wow64_needs_stack_adjustment.  Align comment.
	(_dll_crt0): Ditto.
	* wincap.h (wincaps::wow64_has_secondary_stack): New element.
	* wincap.cc: Implement above element throughout.
	(wincapc::init): Set wow64_has_secondary_stack to false on non-64 bit
	systems.
	* wow64.cc (wow64_needs_stack_adjustment): Rename (hopefully the last
	time) from wow64_has_64bit_parent.
	(wow64_eval_expected_main_stack): Fix comment to reflect real life.
	(wow64_test_for_64bit_parent): Fix comment.
	* wow64.h (wow64_needs_stack_adjustment): Accommodate new name.
This commit is contained in:
Corinna Vinschen
2011-12-19 12:50:35 +00:00
parent 93a61a6fe3
commit f08bc85858
6 changed files with 53 additions and 17 deletions

View File

@@ -705,11 +705,12 @@ dll_crt0_0 ()
if (!child_proc_info)
{
memory_init (true);
/* WOW64 process? Check if we have been started from 64 bit process
and if our stack is at an unusual address. Set wow64_has_64bit_parent
if so. Problem description in wow64_test_for_64bit_parent. */
if (wincap.is_wow64 ())
wow64_has_64bit_parent = wow64_test_for_64bit_parent ();
/* 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 ();
}
else
{
@@ -945,9 +946,10 @@ __cygwin_exit_return: \n\
extern "C" void __stdcall
_dll_crt0 ()
{
/* Handle WOW64 process started from native 64 bit process. See comment
in wow64_test_for_64bit_parent for a full problem description. */
if (wow64_has_64bit_parent && !dynamically_loaded)
/* 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 pointers have
been moved. */