浏览代码

Bug 618, Thomas Chou: update crt to new 0.9.28 uClibc style

Mike Frysinger 20 年之前
父节点
当前提交
bbb8bf360e
共有 1 个文件被更改,包括 10 次插入8 次删除
  1. 10 8
      libc/sysdeps/linux/nios/crt1.S

+ 10 - 8
libc/sysdeps/linux/nios/crt0.S → libc/sysdeps/linux/nios/crt1.S

@@ -27,7 +27,8 @@ Cambridge, MA 02139, USA.  */
     .type   __start,@function
     .weak   _init
     .weak   _fini
-    .type   __uClibc_start_main,@function
+    .type   main,@function
+    .type   __uClibc_main,@function
     .type   __h_errno_location, @function
     .type   _stdio_init, @function
     .type   _stdio_term, @function
@@ -38,15 +39,17 @@ _start:
 	nop
 	nop
 
-	lds	%o0,[%sp, (REGWIN_SZ / 4) + 0]	// main's argc
-	lds	%o1,[%sp, (REGWIN_SZ / 4) + 1]	// main's argv
-	lds	%o2,[%sp, (REGWIN_SZ / 4) + 2]	// main's envp
+	MOVIA	%o0, main@h
+	lds	%o1,[%sp, (REGWIN_SZ / 4) + 0]	// main's argc
+	lds	%o2,[%sp, (REGWIN_SZ / 4) + 1]	// main's argv
 
 	MOVIA	%o3, _init@h
 	MOVIA	%o4, _fini@h
-	MOVIA	%o5, __uClibc_start_main@h
-	
-	call	%o5
+	mov	%o5, %i0	/* rtld_fini */
+	mov	%o6, %sp	/* stack_end */
+	MOVIA	%o7, __uClibc_main@h
+
+	call	%o7
 	nop
 
 
@@ -54,4 +57,3 @@ _start:
 __exit:
 	MOVIP	%g1, __NR_exit
 	trap	63
-