Cygwin: _dll_crt0: minimize target-specific conditional code
Only the assembler snippet is really x86_64-specific, so minimize the conditional code block to this snippet. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
e46f15c2d1
commit
5192d5ea51
|
@ -1016,7 +1016,6 @@ __cygwin_exit_return: \n\
|
||||||
extern "C" void __stdcall
|
extern "C" void __stdcall
|
||||||
_dll_crt0 ()
|
_dll_crt0 ()
|
||||||
{
|
{
|
||||||
#ifdef __x86_64__
|
|
||||||
/* Starting with Windows 10 rel 1511, the main stack of an application is
|
/* Starting with Windows 10 rel 1511, the main stack of an application is
|
||||||
not reproducible if a 64 bit process has been started from a 32 bit
|
not reproducible if a 64 bit process has been started from a 32 bit
|
||||||
process. Given that we have enough virtual address space on 64 bit
|
process. Given that we have enough virtual address space on 64 bit
|
||||||
|
@ -1033,6 +1032,7 @@ _dll_crt0 ()
|
||||||
PVOID stackaddr = create_new_main_thread_stack (allocationbase);
|
PVOID stackaddr = create_new_main_thread_stack (allocationbase);
|
||||||
if (stackaddr)
|
if (stackaddr)
|
||||||
{
|
{
|
||||||
|
#ifdef __x86_64__
|
||||||
/* Set stack pointer to new address. Set frame pointer to
|
/* Set stack pointer to new address. Set frame pointer to
|
||||||
stack pointer and subtract 32 bytes for shadow space. */
|
stack pointer and subtract 32 bytes for shadow space. */
|
||||||
__asm__ ("\n\
|
__asm__ ("\n\
|
||||||
|
@ -1040,6 +1040,9 @@ _dll_crt0 ()
|
||||||
movq %%rsp, %%rbp \n\
|
movq %%rsp, %%rbp \n\
|
||||||
subq $32,%%rsp \n"
|
subq $32,%%rsp \n"
|
||||||
: : [ADDR] "r" (stackaddr));
|
: : [ADDR] "r" (stackaddr));
|
||||||
|
#else
|
||||||
|
#error unimplemented for this target
|
||||||
|
#endif
|
||||||
/* We're on the new stack now. Free up space taken by the former
|
/* We're on the new stack now. Free up space taken by the former
|
||||||
main thread stack and set DeallocationStack correctly. */
|
main thread stack and set DeallocationStack correctly. */
|
||||||
VirtualFree (NtCurrentTeb ()->DeallocationStack, 0, MEM_RELEASE);
|
VirtualFree (NtCurrentTeb ()->DeallocationStack, 0, MEM_RELEASE);
|
||||||
|
@ -1049,9 +1052,6 @@ _dll_crt0 ()
|
||||||
else
|
else
|
||||||
fork_info->alloc_stack ();
|
fork_info->alloc_stack ();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#error unimplemented for this target
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fesetenv (FE_DFL_ENV);
|
fesetenv (FE_DFL_ENV);
|
||||||
_main_tls = &_my_tls;
|
_main_tls = &_my_tls;
|
||||||
|
|
Loading…
Reference in New Issue