aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/crt-arm-Scrt1.s
blob: b8fdfda9950c475364eb1384ffb8258e02764eb3 (plain)
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
.weak _init
.weak _fini
.text
.global _start
_start:
        mov fp,#0
        mov lr,#0

        pop { a2 }
        mov a3, sp
        push { a3 }
        push { a1 }

        ldr sl, .L_GOT
        adr a4, .L_GOT
        add sl, sl, a4
        ldr ip, .L_GOT+4
        ldr ip, [sl, ip]
        push { ip }
        ldr a4, .L_GOT+8
        ldr a4, [sl, a4]
        ldr a1, .L_GOT+12
        ldr a1, [sl, a1]

        bl __libc_start_main(PLT)
1:      b 1b

        .align 2
.L_GOT:
        .word _GLOBAL_OFFSET_TABLE_ - .L_GOT
        .word _fini(GOT)
        .word _init(GOT)
        .word main(GOT)