Patchwork [U-Boot,v3,08/15] arm, davinci: Fix clear bss loop for zero length bss

login
register
mail settings
Submitter Christian Riesch
Date Nov. 25, 2011, 12:37 p.m.
Message ID <1322224664-3747-9-git-send-email-christian.riesch@omicron.at>
Download mbox | patch
Permalink /patch/127690/
State Superseded
Headers show

Comments

Christian Riesch - Nov. 25, 2011, 12:37 p.m.
This patch fixes the clear bss loop for bss sections that have
zero length, i.e., where __bss_start == __bss_end__.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Heiko Schocher <hs@denx.de>
---
 arch/arm/cpu/arm926ejs/start.S |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 8b5355b..772793c 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -299,10 +299,12 @@  clear_bss:
 #endif
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop...		    */
+	beq	clbss_e
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 #ifndef CONFIG_SPL_BUILD
 	bl coloured_LED_init