svn commit: trunk/uClibc/libc/sysdeps/linux/nios2

vapier at uclibc.org vapier at uclibc.org
Fri Dec 30 06:54:34 UTC 2005


Author: vapier
Date: 2005-12-29 22:54:32 -0800 (Thu, 29 Dec 2005)
New Revision: 13023

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

Added:
   trunk/uClibc/libc/sysdeps/linux/nios2/crt1.S

Removed:
   trunk/uClibc/libc/sysdeps/linux/nios2/crt0.S


Changeset:
Deleted: trunk/uClibc/libc/sysdeps/linux/nios2/crt0.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/nios2/crt0.S	2005-12-30 06:27:33 UTC (rev 13022)
+++ trunk/uClibc/libc/sysdeps/linux/nios2/crt0.S	2005-12-30 06:54:32 UTC (rev 13023)
@@ -1,64 +0,0 @@
-/*
- * libc/sysdeps/linux/nios2/crt0.S -- entry point for linux/nios2
- *
- *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
- *
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License.  See the file COPYING.LIB in the main
- * directory of this archive for more details.
- * 
- * Written by Wentao Xu <wentao at microtronix.com>
- * 
- */
-
-#include <features.h>
-#include <asm/unistd.h>
-
-    .global _start
-    .type   __start, at function
-    .weak   _init
-    .weak   _fini
-    .type   __uClibc_start_main, at function
-    .type   __h_errno_location, @function
-    .type   _stdio_init, @function
-    .type   _stdio_term, @function
-    .text
-	.balign 4
-_start:
-    nop
-    br 0f
-	.long _stext	/* start address of .text + 4 */
-	.long _etext	/* start address of .data */
-	.long _edata	/* start address of .bss */
-0:
-    /* load gp */
-    movhi gp, %hiadj(_gp)
-    addi gp, gp, %lo(_gp)
-
-    /* load argc, argv, envp from stack */
-    ldw r4, 0(sp)
-    ldw r5, 4(sp)
-    ldw r6, 8(sp)
-    
-    /* load the 4th arg */
-    movhi r7, %hi(_init)
-    ori  r7, r7, %lo(_init)
-  
-    /* reuse the argc stack slot for the 5th arg */
-    movhi r8, %hi(_fini)
-    ori  r8, r8, %lo(_fini)
-    stw  r8, 0(sp)
-   
-    /* call uClibc_main, shouldn't return */
-#ifdef __PIC__
-    /* just pray 16 bit offset is enough */
-    br __uClibc_start_main
-#else
-    call __uClibc_start_main
-#endif
-
-    /* crash in the event of return */
-__exit:
-    movui r2, TRAP_ID_SYSCALL
-    movui r3, __NR_exit
-    trap
\ No newline at end of file

Copied: trunk/uClibc/libc/sysdeps/linux/nios2/crt1.S (from rev 13017, trunk/uClibc/libc/sysdeps/linux/nios2/crt0.S)
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/nios2/crt0.S	2005-12-30 00:59:58 UTC (rev 13017)
+++ trunk/uClibc/libc/sysdeps/linux/nios2/crt1.S	2005-12-30 06:54:32 UTC (rev 13023)
@@ -0,0 +1,70 @@
+/*
+ * libc/sysdeps/linux/nios2/crt0.S -- entry point for linux/nios2
+ *
+ *  Copyright (C) 2004,05,06  Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License.  See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ * 
+ * Written by Wentao Xu <wentao at microtronix.com>
+ * Updated by Thomas Chou <thomas at wytron.com.tw> for crt1.S
+ * 
+ */
+
+#include <features.h>
+#include <asm/unistd.h>
+
+    .global _start
+    .type   __start, at function
+    .weak   _init
+    .weak   _fini
+    .type   main, at function
+    .type   __uClibc_main, at function
+    .type   __h_errno_location, @function
+    .type   _stdio_init, @function
+    .type   _stdio_term, @function
+    .text
+	.balign 4
+_start:
+    nop
+    br 0f
+	.long _stext	/* start address of .text + 4 */
+	.long _etext	/* start address of .data */
+	.long _edata	/* start address of .bss */
+0:
+    /* load gp */
+    movhi gp, %hiadj(_gp)
+    addi gp, gp, %lo(_gp)
+
+    /* load main, argc, argv from stack */
+    movhi r4, %hi(main)
+    ori  r4, r4, %lo(main)	/* main */
+    ldw r5, 0(sp)		/* argc */
+    ldw r6, 4(sp)		/* argv */
+
+    /* load the 4th arg */
+    movhi r7, %hi(_init)
+    ori  r7, r7, %lo(_init)
+
+    /* reuse the argc stack slot for the 5th arg */
+    movhi r8, %hi(_fini)
+    ori  r8, r8, %lo(_fini)
+    stw  r8, 0(sp)
+
+    stw  r2, 4(sp)		/* rtld_fini */
+    stw  sp, 8(sp)		/* stack_end */
+
+    /* call uClibc_main, shouldn't return */
+#ifdef __PIC__
+    /* just pray 16 bit offset is enough */
+    br __uClibc_main
+#else
+    call __uClibc_main
+#endif
+
+    /* crash in the event of return */
+__exit:
+    movui r2, TRAP_ID_SYSCALL
+    movui r3, __NR_exit
+    trap




More information about the uClibc-cvs mailing list