1
0
mirror of https://github.com/golang/go synced 2024-11-20 09:14:46 -07:00
go/src/runtime/rt0_linux_ppc64.s
Austin Clements af7ca8dce4 cmd/cgo, runtime/cgo: support ppc64
This implements support for calls to and from C in the ppc64 C ABI, as
well as supporting functionality such as an entry point from the
dynamic linker.

Change-Id: I68da6df50d5638cb1a3d3fef773fb412d7bf631a
Reviewed-on: https://go-review.googlesource.com/2009
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 20:36:27 +00:00

24 lines
609 B
ArmAsm

#include "textflag.h"
// actually a function descriptor for _main<>(SB)
TEXT _rt0_ppc64_linux(SB),NOSPLIT,$0
DWORD $_main<>(SB)
DWORD $0
DWORD $0
TEXT _main<>(SB),NOSPLIT,$-8
// In a statically linked binary, the stack contains argc,
// argv as argc string pointers followed by a NULL, envv as a
// sequence of string pointers followed by a NULL, and auxv.
// There is no TLS base pointer.
//
// TODO(austin): Support ABI v1 dynamic linking entry point
MOVD 0(R1), R3 // argc
ADD $8, R1, R4 // argv
BR main(SB)
TEXT main(SB),NOSPLIT,$-8
MOVD $runtime·rt0_go(SB), R31
MOVD R31, CTR
BR (CTR)