Black Lives Matter. Support the Equal Justice Initiative.

Text file src/runtime/rt0_linux_ppc64.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  #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  	MOVD	$runtime·rt0_go(SB), R12
    26  	MOVD	R12, CTR
    27  	MOVBZ	runtime·iscgo(SB), R5
    28  	CMP	R5, $0
    29  	BEQ	nocgo
    30  	BR	(CTR)
    31  nocgo:
    32  	MOVD	0(R1), R3 // argc
    33  	ADD	$8, R1, R4 // argv
    34  	BR	(CTR)
    35  

View as plain text