Browse Source

* Pass exitcode correctly down to __libc_start_main in _haltproc

git-svn-id: trunk@34258 -
pierre 9 years ago
parent
commit
b2467eae3b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      rtl/linux/mips/cprt0.as

+ 4 - 1
rtl/linux/mips/cprt0.as

@@ -147,8 +147,11 @@ _haltproc:
         lw      $sp,%lo(__fpc_ret_sp)($v0)
         lui     $v0,%hi(__fpc_ret_ra)
         lw      $ra,%lo(__fpc_ret_ra)($v0)
+	/* $a0 contains exitcode, we need to move it to $v0,
+	   as it would be at return of C main unction.  */
+        move	$v0,$a0
         jr      $ra
-        nop
+	nop
 hlt:
         b hlt
         .end _haltproc