From mboxrd@z Thu Jan 1 00:00:00 1970 From: Minkyu Kang Date: Mon, 27 Dec 2010 19:27:31 +0900 Subject: [U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL Message-ID: <4D186A13.4080004@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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