diff options
-rw-r--r-- | libgloss/ChangeLog | 5 | ||||
-rw-r--r-- | libgloss/nds32/crt0.S | 7 | ||||
-rw-r--r-- | libgloss/nds32/crt1.S | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 4cd4168..42c1bac 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,5 +1,10 @@ 2014-03-21 Sabrini Ni <sabrinanitw@gmail.com> + * nds32/crt0.S: Set argc=argv=env=0. + * nds32/crt1.S: Ditto. + +2014-03-21 Sabrini Ni <sabrinanitw@gmail.com> + * nds32/Makefile.in: Add syscall_error_handler.o. * nds32/syscall_error_handler.S: New. * nds32/syscall_extra.h: Reduce code size. diff --git a/libgloss/nds32/crt0.S b/libgloss/nds32/crt0.S index d12be76..97c02c5 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 26aef5b..60c18c3 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 |