2f658b76a2cb22463642b353666bb74ae130d7a3
[musl] / crt / arm / crti.s
1 .section .init
2 .global _init
3 _init:
4         push {r0,r1,r2,r4,r5,lr}
5
6 .weak __fini_array_start
7 .weak __fini_array_end
8
9 .section .fini
10 .global _fini
11 _fini:
12         push {r4,r5,r6,lr}
13         adr lr, 1f
14         ldr r4, 2f
15         ldr r5, 2f+4
16         add r4, r4, lr
17         add r5, r5, lr
18 1:      adr lr, 1b
19         cmp r4, r5
20         beq 3f
21         ldmia r4!, {r3}
22         tst r3,#1
23         moveq pc,r3
24         bx r3
25 2:      .word __fini_array_start-1b
26         .word __fini_array_end-1b
27 3: