summaryrefslogtreecommitdiff
path: root/src/ldso/microblaze/start.s
blob: 4e0a0e501ff8fd2578f0d3ac4789ae3aac9532ce (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
# FIXME: clearing argv entries
.global _start
_start:
	add     r19, r0, r0

	lw      r5, r0, r1
	addi    r6, r1, 4
	mfs     r7, rpc
	addi    r7, r7, _GLOBAL_OFFSET_TABLE_+8
	addi    r7, r7, _DYNAMIC@GOTOFF
	brlid   r15, __reloc_self@PLT
	addik   r1, r1, -16

	lwi     r5, r1, 16
	brlid   r15, __dynlink@PLT
	addi    r6, r1, 20
	addik   r1, r1, 16

	lwi     r4, r1, 0
1:	lwi     r5, r1, 4
	addi    r5, r5, 1
	bnei    r5, 1f
	addi    r4, r4, -1
	addi    r1, r1, 4
	bri     1b
1:	swi     r4, r1, 0
	add     r5, r0, r0
	bra     r3