[U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL

Minkyu Kang mk7.kang at samsung.com
Mon Dec 27 11:27:31 CET 2010


There is possibility that pointers set to NULL before relocation.
In this case, system is hang, because of r0 is invalid location in RAM.

Signed-off-by: Minkyu Kang <mk7.kang at samsung.com>
---
 arch/arm/cpu/armv7/start.S |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 684f2d2..4eeb12a 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -195,6 +195,8 @@ copy_loop:
 	add	r3, r3, r0		/* r3 <- rel dyn end in FLASH */
 fixloop:
 	ldr	r0, [r2]		/* r0 <- location to fix up, IN FLASH! */
+	cmp	r0, #0
+	beq	fixskip
 	add	r0, r0, r9		/* r0 <- location to fix up in RAM */
 	ldr	r1, [r2, #4]
 	and	r7, r1, #0xff
@@ -217,6 +219,7 @@ fixrel:
 	add	r1, r1, r9
 fixnext:
 	str	r1, [r0]
+fixskip:
 	add	r2, r2, #8		/* each rel.dyn entry is 8 bytes */
 	cmp	r2, r3
 	blo	fixloop
-- 
1.7.1


More information about the U-Boot mailing list