Explorar o código

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).
Rich Felker %!s(int64=12) %!d(string=hai) anos
pai
achega
9abab94b21
Modificáronse 2 ficheiros con 4 adicións e 0 borrados
  1. 2 0
      crt/arm/crti.s
  2. 2 0
      crt/arm/crtn.s

+ 2 - 0
crt/arm/crti.s

@@ -1,7 +1,9 @@
 .section .init
 .global _init
 _init:
+	push {lr}
 
 .section .fini
 .global _fini
 _fini:
+	push {lr}

+ 2 - 0
crt/arm/crtn.s

@@ -1,9 +1,11 @@
 .section .init
+	pop {lr}
 	tst lr,#1
 	moveq pc,lr
 	bx lr
 
 .section .fini
+	pop {lr}
 	tst lr,#1
 	moveq pc,lr
 	bx lr