aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/amd64
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2011-12-07 16:53:17 +0300
committerDmitriy Vyukov <dvyukov@google.com>2011-12-07 16:53:17 +0300
commit428062da4e5e35ce75178d993dd6d8ef5e3ecb5d (patch)
treeba42071e9fce2013704374474713b920249a2c23 /src/pkg/runtime/amd64
parent5e43527336e056b9c5a51bf0e23e790c86e3affa (diff)
downloadgo-428062da4e5e35ce75178d993dd6d8ef5e3ecb5d.tar.xz
ld: increase default stack size on Windows for cgo
Fixes #2437. R=rsc, hectorchu, mattn.jp, alex.brainman, jdpoirier, snaury, n13m3y3r CC=golang-dev https://golang.org/cl/5371049
Diffstat (limited to 'src/pkg/runtime/amd64')
-rw-r--r--src/pkg/runtime/amd64/asm.s20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/pkg/runtime/amd64/asm.s b/src/pkg/runtime/amd64/asm.s
index 109b95eba8..18cdefb83d 100644
--- a/src/pkg/runtime/amd64/asm.s
+++ b/src/pkg/runtime/amd64/asm.s
@@ -12,13 +12,19 @@ TEXT _rt0_amd64(SB),7,$-8
ANDQ $~15, SP
MOVQ AX, 16(SP)
MOVQ BX, 24(SP)
+
+ // create istack out of the given (operating system) stack.
+ // initcgo may update stackguard.
+ MOVQ $runtime·g0(SB), DI
+ LEAQ (-8192+104)(SP), BX
+ MOVQ BX, g_stackguard(DI)
+ MOVQ SP, g_stackbase(DI)
// if there is an initcgo, call it.
MOVQ initcgo(SB), AX
TESTQ AX, AX
JZ needtls
- LEAQ runtime·g0(SB), DI
- CALL AX
+ CALL AX // g0 already in DI
CMPL runtime·iswindows(SB), $0
JEQ ok
@@ -44,16 +50,6 @@ ok:
// save m->g0 = g0
MOVQ CX, m_g0(AX)
- // create istack out of the given (operating system) stack
- // if there is an initcgo, it had setup stackguard for us
- MOVQ initcgo(SB), AX
- TESTQ AX, AX
- JNZ stackok
- LEAQ (-8192+104)(SP), AX
- MOVQ AX, g_stackguard(CX)
-stackok:
- MOVQ SP, g_stackbase(CX)
-
CLD // convention is D is always left cleared
CALL runtime·check(SB)