Browse Source

* keep stack aligned at 8 byte boundary inside the startup code

git-svn-id: trunk@11934 -
florian 17 years ago
parent
commit
10e0f0e387
3 changed files with 8 additions and 1 deletions
  1. 2 0
      rtl/linux/arm/gprt0.as
  2. 3 1
      rtl/linux/arm/prt0.as
  3. 3 0
      rtl/linux/arm/ucprt0.as

+ 2 - 0
rtl/linux/arm/gprt0.as

@@ -46,6 +46,8 @@ _start:
         /* Save initial stackpointer */
         /* Save initial stackpointer */
 	ldr ip,=__stkptr
 	ldr ip,=__stkptr
 	str sp,[ip]
 	str sp,[ip]
+	/* align sp again to 8 byte boundary, needed by eabi */
+        sub sp,sp,#4
 
 
 	/* Let the libc call main and exit with its return code.  */
 	/* Let the libc call main and exit with its return code.  */
 	bl PASCALMAIN
 	bl PASCALMAIN

+ 3 - 1
rtl/linux/arm/prt0.as

@@ -62,9 +62,11 @@ _start:
 	str sp,[a3]
 	str sp,[a3]
    	str a2,[ip]
    	str a2,[ip]
 
 
-    /* Save initial stackpointer */
+        /* Save initial stackpointer */
 	ldr ip,=__stkptr
 	ldr ip,=__stkptr
 	str sp,[ip]
 	str sp,[ip]
+        /* align sp again to 8 byte boundary, needed by eabi */
+        sub sp,sp,#4
 
 
 	/* Let the libc call main and exit with its return code.  */
 	/* Let the libc call main and exit with its return code.  */
 	bl PASCALMAIN
 	bl PASCALMAIN

+ 3 - 0
rtl/linux/arm/ucprt0.as

@@ -121,6 +121,9 @@ _start:
         ldr ip,=__stkptr
         ldr ip,=__stkptr
         str sp, [ip]
         str sp, [ip]
 
 
+	/* keep stack aligned as required by eabi */
+        sub sp,sp,#4
+
 	/* Push stack limit */
 	/* Push stack limit */
 	str a3, [sp, #-4]!
 	str a3, [sp, #-4]!