shithub: scc

ref: 07c3fc899a4788187f52b99961c7ae1777201d5b
dir: /lib/crt/amd64-sysv-netbsd/crt.s/

View raw version
	.file	"crt.s"

	.section .note.netbsd.ident
	.long   7
	.long   4
	.long   1
	.ascii "NetBSD\0"
	.p2align 2
	.long      200000000

	.bss
	.globl	_environ
_environ:
	.quad	0

	.text
	.align	8
	.global	_start
_start:
	andq	$-16,%rsp
	movq	%rsp,%rbp

	movq	(%rbp),%rdi             # rdi = argc
	leaq	8(%rbp),%rsi            # rsi = argv
	leaq	16(%rbp,%rdi,8),%rdx    # rdx = envp = argv +8*argc + 8
	movq	%rdx,_environ

	call	main
	movl    %eax,%edi
	jmp	exit