Text file
src/runtime/rt0_windows_amd64.s
Documentation: runtime
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 #include "go_asm.h"
6 #include "go_tls.h"
7 #include "textflag.h"
8
9 TEXT _rt0_amd64_windows(SB),NOSPLIT,$-8
10 JMP _rt0_amd64(SB)
11
12 // When building with -buildmode=(c-shared or c-archive), this
13 // symbol is called. For dynamic libraries it is called when the
14 // library is loaded. For static libraries it is called when the
15 // final executable starts, during the C runtime initialization
16 // phase.
17 // Leave space for four pointers on the stack as required
18 // by the Windows amd64 calling convention.
19 TEXT _rt0_amd64_windows_lib(SB),NOSPLIT,$0x20
20 // Create a new thread to do the runtime initialization and return.
21 MOVQ _cgo_sys_thread_create(SB), AX
22 MOVQ $_rt0_amd64_windows_lib_go(SB), CX
23 MOVQ $0, DX
24 CALL AX
25 RET
26
27 TEXT _rt0_amd64_windows_lib_go(SB),NOSPLIT,$0
28 MOVQ $0, DI
29 MOVQ $0, SI
30 MOVQ $runtime·rt0_go(SB), AX
31 JMP AX
32
View as plain text