From 5ff6903e6957efc69f6a5603fa789541bbad37a5 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 21 Mar 2014 20:22:29 +0000 Subject: [PATCH] 2014-03-21 Sabrini Ni * nds32/crt0.S: Set argc=argv=env=0. * nds32/crt1.S: Ditto. --- libgloss/ChangeLog | 5 +++++ libgloss/nds32/crt0.S | 7 +++++++ libgloss/nds32/crt1.S | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 4cd416893..42c1baca2 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,8 @@ +2014-03-21 Sabrini Ni + + * nds32/crt0.S: Set argc=argv=env=0. + * nds32/crt1.S: Ditto. + 2014-03-21 Sabrini Ni * nds32/Makefile.in: Add syscall_error_handler.o. 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