This is the mail archive of the
newlib-cvs@sourceware.org
mailing list for the newlib project.
[newlib-cygwin] * rl78/crt0.S (_start): Fixed code that clears .bss
- From: DJ Delorie <dj at sourceware dot org>
- To: newlib-cvs at sourceware dot org
- Date: 21 Oct 2015 01:38:34 -0000
- Subject: [newlib-cygwin] * rl78/crt0.S (_start): Fixed code that clears .bss
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9e8f75612433be5719b029e8175b2100d97df1db
commit 9e8f75612433be5719b029e8175b2100d97df1db
Author: DJ Delorie <dj@redhat.com>
Date: Tue Oct 20 21:37:06 2015 -0400
* rl78/crt0.S (_start): Fixed code that clears .bss
Diff:
---
libgloss/ChangeLog | 4 ++++
libgloss/rl78/crt0.S | 22 ++++++++++++----------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index be11a3c..d372c69 100644
--- a/libgloss/ChangeLog
+++ b/libgloss/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-20 Kaushik Phatak <kaushik.phatak@kpit.com>
+
+ * rl78/crt0.S (_start): Fixed code that clears .bss
+
2015-10-06 Nick Clifton <nickc@redhat.com>
* msp430/msp430-sim.ld: Add .persistent section.
diff --git a/libgloss/rl78/crt0.S b/libgloss/rl78/crt0.S
index fbba093..649178c 100644
--- a/libgloss/rl78/crt0.S
+++ b/libgloss/rl78/crt0.S
@@ -176,16 +176,18 @@ _start:
;; block fill to .bss
- movw bc, #__bsssize
- movw ax, #0
-1:
- cmpw ax, bc
- bz $1f
- movw __bssstart[bc], ax
- decw bc
- decw bc
- br $1b
-1:
+ movw bc, #__bsssize
+ movw ax, #0
+ cmpw ax, bc
+ bz $_bss_zero_done
+1:
+ decw bc
+ decw bc
+ movw __bssstart[bc], ax
+ cmpw ax, bc
+ bnz $1b
+
+_bss_zero_done:
call !!__rl78_init