go runtime walkthrough - modrpc/info GitHub Wiki
-
main(SB),NOSPLIT,$-8
- jump to
$runtime.rt0_go(SB), AX
- SB: Static base pointer: global symbols.
- see Go assembler guide] for basic
- jump to
- entry point
- copy arguments on an even stack
- create istack out of the given OS stack.
- needtls
- if tls needed jump to
runtime.settls(SB)
- if tls needed jump to
- set the per-goroutine and per-mach "registers"
get_tls(BX)
LEAQ runtime.g0(SB), CX
MOVQ CX, g(BX)
-
LEAQ runtime.m0(SB), AX
]
CALL runtime.args(SB)
CALL runtime.osinit(SB)
CALL runtime.schedinit(SB)
-
MOVQ runtime.mainPC(SB), AX
: entry CALL runtime.newproc(SB)
CALL runtime.mstart(SB)