github.com/fjballest/golang@v0.0.0-20151209143359-e4c5fe594ca8/src/runtime/rt0_linux_mips64x.s (about)

     1  // Copyright 2015 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  // +build linux
     6  // +build mips64 mips64le
     7  
     8  #include "textflag.h"
     9  
    10  TEXT _rt0_mips64_linux(SB),NOSPLIT,$0
    11  	JMP	_main<>(SB)
    12  
    13  TEXT _rt0_mips64le_linux(SB),NOSPLIT,$0
    14  	JMP	_main<>(SB)
    15  
    16  TEXT _main<>(SB),NOSPLIT,$-8
    17  	// In a statically linked binary, the stack contains argc,
    18  	// argv as argc string pointers followed by a NULL, envv as a
    19  	// sequence of string pointers followed by a NULL, and auxv.
    20  	// There is no TLS base pointer.
    21  #ifdef GOARCH_mips64
    22  	MOVW 4(R29), R1 // argc, big-endian ABI places int32 at offset 4
    23  #else
    24  	MOVW 0(R29), R1 // argc
    25  #endif
    26  	ADDV $8, R29, R2 // argv
    27  	JMP main(SB)
    28  
    29  TEXT main(SB),NOSPLIT,$-8
    30  	MOVV	$runtime·rt0_go(SB), R4
    31  	JMP	(R4)