summaryrefslogtreecommitdiff
path: root/crt.s
blob: 66e9575a0db223f3d7dadbbf73e019ee11b2392b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	.seg	".text"

	.global	_start

_start:
	clr	%fp

	orcc	0,%g1,%o0
	be	no_atexit
	sub	%sp,32,%sp

	call	atexit
	nop

no_atexit:
	sethi	%hi _fini,%o0
	call	_init
	or	%o0,%lo _fini,%o0
	
	ld	[%sp+32+64],%o0
	add	32+68,%sp,%o1
	sll	%o0,2,%o2
	inc	4,%o2
	set	_environ,%o3
	call	main
	add	%o1,%o2,%o2

	call	exit
	nop
	
	call	_exit
	nop