Text file src/runtime/rt0_linux_ppc64.s

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

View as plain text