github.com/megatontech/mynoteforgo@v0.0.0-20200507084910-5d0c6ea6e890/源码/runtime/rt0_linux_ppc64.s (about)

     1  #include "textflag.h"
     2  
     3  // actually a function descriptor for _main<>(SB)
     4  TEXT _rt0_ppc64_linux(SB),NOSPLIT,$0
     5  	DWORD $_main<>(SB)
     6  	DWORD $0
     7  	DWORD $0
     8  
     9  TEXT main(SB),NOSPLIT,$0
    10  	DWORD $_main<>(SB)
    11  	DWORD $0
    12  	DWORD $0
    13  
    14  TEXT _main<>(SB),NOSPLIT,$-8
    15  	// In a statically linked binary, the stack contains argc,
    16  	// argv as argc string pointers followed by a NULL, envv as a
    17  	// sequence of string pointers followed by a NULL, and auxv.
    18  	// There is no TLS base pointer.
    19  	//
    20  	// TODO(austin): Support ABI v1 dynamic linking entry point
    21  	MOVD	$runtime·rt0_go(SB), R12
    22  	MOVD	R12, CTR
    23  	MOVBZ	runtime·iscgo(SB), R5
    24  	CMP	R5, $0
    25  	BEQ	nocgo
    26  	BR	(CTR)
    27  nocgo:
    28  	MOVD	0(R1), R3 // argc
    29  	ADD	$8, R1, R4 // argv
    30  	BR	(CTR)