浏览代码

fix loading of argc/argv for arm/nommu

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

+ 10 - 0
libc/sysdeps/linux/arm/crt1.S

@@ -110,9 +110,19 @@ _start:
 	mov fp, #0
 	mov fp, #0
 	mov lr, #0
 	mov lr, #0
 
 
+#ifdef __ARCH_HAS_MMU__
 	/* Pop argc off the stack and save a pointer to argv */
 	/* Pop argc off the stack and save a pointer to argv */
 	ldr a2, [sp], #4
 	ldr a2, [sp], #4
 	mov a3, sp
 	mov a3, sp
+#else
+	/*
+	 * uClinux/arm stacks look a little different from normal
+	 * MMU-full Linux/arm stacks (for no good reason)
+	 */
+	/* pull argc and argv off the stack */
+	ldr a2, [sp, #0]
+	ldr a3, [sp, #4]
+#endif
 
 
 	/* Push stack limit */
 	/* Push stack limit */
 	str a3, [sp, #-4]!
 	str a3, [sp, #-4]!