summaryrefslogtreecommitdiffstats
path: root/libgloss/nds32
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/nds32')
-rw-r--r--libgloss/nds32/crt0.S7
-rw-r--r--libgloss/nds32/crt1.S6
2 files changed, 13 insertions, 0 deletions
diff --git a/libgloss/nds32/crt0.S b/libgloss/nds32/crt0.S
index d12be761f..97c02c5c4 100644
--- a/libgloss/nds32/crt0.S
+++ b/libgloss/nds32/crt0.S
@@ -94,6 +94,13 @@ _start:
.L_call_main:
+ /* Prepare argc/argv/env for main function.
+ Since there is no operating system so far,
+ we set $r0, $r1, and $r2 to be zero. */
+ movi $r0, 0
+ movi $r1, 0
+ movi $r2, 0
+ /* Call 'main'. */
la $r15, main
jral $r15
diff --git a/libgloss/nds32/crt1.S b/libgloss/nds32/crt1.S
index 26aef5b51..60c18c318 100644
--- a/libgloss/nds32/crt1.S
+++ b/libgloss/nds32/crt1.S
@@ -100,6 +100,12 @@ _start:
exit() has been reached. */
la $r0, _fini
jal atexit
+ /* Prepare argc/argv/env for main function.
+ Since there is no operating system so far,
+ we set $r0, $r1, and $r2 to be zero. */
+ movi $r0, 0
+ movi $r1, 0
+ movi $r2, 0
/* Call 'main'. */
la $r15, main
jral $r15