Files
semi-libc/src/ldso/powerpc/start.s
T
Rich Felker 3fa2eb2aba rename dynamic linker entry point from _start to _dlstart
the main motivation for this change is to aid in debugging. since the
main program's entry point is also named _start, it was difficult to
set breakpoints or quickly identify which _start execution stopped in.
2014-06-20 00:25:12 -04:00

30 lines
435 B
ArmAsm

.global _dlstart
.type _dlstart,@function
_dlstart:
bl 1f
2: .long _DYNAMIC-2b
1: mflr 5
lwz 0, 0(5)
add 5, 0, 5
lwz 3, 0(1)
addi 4, 1, 4
addi 1, 1, -16
bl __reloc_self
lwz 3, 16(1)
addi 4, 1, 20
bl __dynlink
addi 1, 1, 16
lwz 4, 0(1)
1: addi 4, 4, -1
lwzu 5, 4(1)
cmpwi 5, -1
beq- 1b
addi 4, 4, 1
stwu 4, -4(1)
mtlr 3
li 3, 0
blr