Text file
src/runtime/rt0_linux_loong64.s
1 // Copyright 2022 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 "textflag.h"
6
7 TEXT _rt0_loong64_linux(SB),NOSPLIT,$0
8 JMP _main<>(SB)
9
10 TEXT _main<>(SB),NOSPLIT|NOFRAME,$0
11 // In a statically linked binary, the stack contains argc,
12 // argv as argc string pointers followed by a NULL, envv as a
13 // sequence of string pointers followed by a NULL, and auxv.
14 // There is no TLS base pointer.
15 MOVW 0(R3), R4 // argc
16 ADDV $8, R3, R5 // argv
17 JMP main(SB)
18
19 TEXT main(SB),NOSPLIT|NOFRAME,$0
20 // in external linking, glibc jumps to main with argc in R4
21 // and argv in R5
22
23 MOVV $runtime·rt0_go(SB), R19
24 JMP (R19)
25
View as plain text