crti.s 434 B

1234567891011121314151617181920212223242526272829
  1. .section .init
  2. .global _init
  3. _init:
  4. push {r0,r1,r2,r4,r5,lr}
  5. .weak __fini_array_start
  6. .weak __fini_array_end
  7. .hidden __fini_array_start
  8. .hidden __fini_array_end
  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: