Black Lives Matter. Support the Equal Justice Initiative.

Text file src/runtime/rt0_linux_mipsx.s

Documentation: runtime

     1  // Copyright 2016 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  //go:build linux && (mips || mipsle)
     6  // +build linux
     7  // +build mips mipsle
     8  
     9  #include "textflag.h"
    10  
    11  TEXT _rt0_mips_linux(SB),NOSPLIT,$0
    12  	JMP	_main<>(SB)
    13  
    14  TEXT _rt0_mipsle_linux(SB),NOSPLIT,$0
    15  	JMP	_main<>(SB)
    16  
    17  TEXT _main<>(SB),NOSPLIT|NOFRAME,$0
    18  	// In a statically linked binary, the stack contains argc,
    19  	// argv as argc string pointers followed by a NULL, envv as a
    20  	// sequence of string pointers followed by a NULL, and auxv.
    21  	// There is no TLS base pointer.
    22  	MOVW	0(R29), R4 // argc
    23  	ADD	$4, R29, R5 // argv
    24  	JMP	main(SB)
    25  
    26  TEXT main(SB),NOSPLIT|NOFRAME,$0
    27  	// In external linking, libc jumps to main with argc in R4, argv in R5
    28  	MOVW	$runtime·rt0_go(SB), R1
    29  	JMP	(R1)
    30  

View as plain text