Pārlūkot izejas kodu

Don't trash regs r0-r2, fix thanks to Michiel Thuys <michiel.thuys@intersil.com>.

Eric Andersen 24 gadi atpakaļ
vecāks
revīzija
c4685a5c3c
1 mainītis faili ar 77 papildinājumiem un 74 dzēšanām
  1. 77 74
      libc/sysdeps/linux/arm/crt0pic.S

+ 77 - 74
libc/sysdeps/linux/arm/crt0pic.S

@@ -1,74 +1,77 @@
-.text
+.text
-	.align 2
+	.align 2
-	.global __environ
+	.global __environ
-	.global _start
+	.global _start
-	.global exit
+	.global exit
-	.global main
+	.global main
-	.global __libc_init
+	.global __libc_init
-	.global __init_stdio
+	.global __init_stdio
-	.global __stdio_close_all
+	.global __stdio_close_all
-	.global _void_void_null_func
+	.global _void_void_null_func
-
+
-	.type   _start,%function
+	.type   _start,%function
-	.type   exit,%function
+	.type   exit,%function
-	.type   main,%function
+	.type   main,%function
-	.type   __libc_init,%function
+	.type   __libc_init,%function
-	.type   __init_stdio,%function
+	.type   __init_stdio,%function
-	.type   __stdio_close_all,%function
+	.type   __stdio_close_all,%function
-	.type   _void_void_null_func,%function
+	.type   _void_void_null_func,%function
-
+
-
+
-
+
-@ r0 = argc
+@ r0 = argc
-@ r1 = argv
+@ r1 = argv
-@ r2 = envp
+@ r2 = envp
-@ sl = data segment
+@ sl = data segment
-
+
-.text
+.text
-_start:
+_start:
-	@ adjust the data segment base pointer
+	@ adjust the data segment base pointer
-	ldr r3,=__data_start
+	ldr r3,=__data_start
-	sub sl,sl,r3
+	sub sl,sl,r3
-	mov r9,sl
+	mov r9,sl
-
+
-	ldr r3, .L3
+	ldr r3, .L3
-	str r2,[r9,r3]
+	str r2,[r9,r3]
-	ldr r0,[sp, #0]
+	
-	ldr r1,[sp, #4]
+	/* Tell libc to initialize whatever it needs */
-	ldr r2,[sp, #8]
+        bl __libc_init		    
-	
+        bl __init_stdio
-	/* Tell libc to initialize whatever it needs */
+
-        bl __libc_init		    
+	/* pull argc, argv and envp off the stack */
-        bl __init_stdio
+	ldr r0,[sp, #0]
-	bl      main
+	ldr r1,[sp, #4]
-/*	ldr r0,=0  */
+	ldr r2,[sp, #8]
-	bl      exit
+
-
+	bl      main
-_void_void_null_func:
+/*	ldr r0,=0  */
-	nop
+	bl      exit
-
+
-.weak __libc_init
+_void_void_null_func:
-__libc_init = _void_void_null_func
+	nop
-
+
-.weak __init_stdio
+.weak __libc_init
-__init_stdio = _void_void_null_func
+__libc_init = _void_void_null_func
-
+
-.weak __stdio_close_all
+.weak __init_stdio
-__stdio_close_all = _void_void_null_func
+__init_stdio = _void_void_null_func
-
+
-.align 2
+.weak __stdio_close_all
-.L3:
+__stdio_close_all = _void_void_null_func
-	.word environ
+
-
+.align 2
-
+.L3:
-.data
+	.word environ
-	.align 2
+
-	.global __environ
+
-	
+.data
-__environ:  
+	.align 2
-	.long 0
+	.global __environ
-
+	
-.weak environ
+__environ:  
-environ = __environ
+	.long 0
-
+
-
+.weak environ
+environ = __environ
+
+