mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 07:12:15 +00:00
fix arm crti/crtn code
lr must be saved because init/fini-section code from the compiler clobbers it. this was not a problem when i tested without gcc's crtbegin/crtend files present, but with them, musl on arm fails to work (infinite loop in _init).
This commit is contained in:
parent
ec820f1262
commit
9abab94b21
@ -1,7 +1,9 @@
|
|||||||
.section .init
|
.section .init
|
||||||
.global _init
|
.global _init
|
||||||
_init:
|
_init:
|
||||||
|
push {lr}
|
||||||
|
|
||||||
.section .fini
|
.section .fini
|
||||||
.global _fini
|
.global _fini
|
||||||
_fini:
|
_fini:
|
||||||
|
push {lr}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
.section .init
|
.section .init
|
||||||
|
pop {lr}
|
||||||
tst lr,#1
|
tst lr,#1
|
||||||
moveq pc,lr
|
moveq pc,lr
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
.section .fini
|
.section .fini
|
||||||
|
pop {lr}
|
||||||
tst lr,#1
|
tst lr,#1
|
||||||
moveq pc,lr
|
moveq pc,lr
|
||||||
bx lr
|
bx lr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user