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

vapier at uclibc.org vapier at uclibc.org
Wed Jan 10 14:18:40 PST 2007


Author: vapier
Date: 2007-01-10 14:18:39 -0800 (Wed, 10 Jan 2007)
New Revision: 17233

Log:
merge from blackfin.uclinux.org: Adjust
crt1.S so that __uClibc_main is called properly

Modified:
   trunk/uClibc/libc/sysdeps/linux/bfin/crt1.S


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/bfin/crt1.S
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/crt1.S	2007-01-10 22:03:34 UTC (rev 17232)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/crt1.S	2007-01-10 22:18:39 UTC (rev 17233)
@@ -83,6 +83,7 @@
 	L3 = 0;
 
 #ifdef __ID_SHARED_LIB__
+	/* We know we have a local copy, so we can avoid the GOT.  */
 	CALL ___shared_flat_add_library;
 #endif
 /*	Load register R1 (argc) from the stack to its final resting place */
@@ -92,24 +93,15 @@
 /*	Copy argv pointer into R2 -- which its final resting place */
 	R2 = P0;
 
-/*	Skip to the end of argv and put a pointer to the environment in
-	[SP + 12] */
-	R3 = R1;
-	R3 <<= 2;
-	R3 += 4;
-	R3 = R2 + R3;
+	SP += -28;
 
-	P2 = SP;
-	SP += -32;
-	[SP + 12] = R3;
-
 #ifndef __BFIN_FDPIC__
 	R7 = 0;
 #endif
 	/* Pass highest stack pointer to the app.  */
-	[SP + 28] = P2;
+	[SP + 24] = P2;
 	/* Store the pointer to ld.so's fini that we got in P1.  */
-	[SP + 24] = R7;
+	[SP + 20] = R7;
 
 /*	Ok, now run uClibc's main() -- shouldn't return */
 #if defined L_crt1 && defined __UCLIBC_CTOR_DTOR__
@@ -123,8 +115,9 @@
 	R3.H = __init;
 	R3.L = __init;
 #endif
-	[SP+16] = R3;
+	[SP+12] = R3;
 
+
 #ifdef __BFIN_FDPIC__
 	R3 = [P3 + __fini at FUNCDESC_GOT17M4];
 #elif defined __ID_SHARED_LIB__
@@ -133,11 +126,11 @@
 	R3.H = __fini;
 	R3.L = __fini;
 #endif
-	[SP+20] = R3;
+	[SP+16] = R3;
 #else /* no ctor/dtor handling */
 	R3 = 0;
+	[SP + 12] = R3;
 	[SP + 16] = R3;
-	[SP + 20] = R3;
 #endif
 
 #ifdef __BFIN_FDPIC__
@@ -162,8 +155,8 @@
 	.type lib_main, at function
 lib_main:
 	RETS = [SP++];
-	P0 = [P5 + ___shared_flat_add_library at GOT];
-	JUMP (P0);
+	/* We know we have a local copy, so we can avoid the GOT.  */
+	JUMP.L ___shared_flat_add_library;
 
 	.hidden _current_shared_library_p5_offset_
 #endif



More information about the uClibc-cvs mailing list