From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sat, 08 Jan 2011 11:49:58 +0100 Subject: [U-Boot] [PATCH RFC] armv7: fixloop: don't fixup if location is NULL In-Reply-To: <24AA7201-FEC9-4485-837F-52CF0CBD06C4@googlemail.com> References: <4D186A13.4080004@samsung.com> <24AA7201-FEC9-4485-837F-52CF0CBD06C4@googlemail.com> Message-ID: <4D284156.90305@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 08/01/2011 11:32, Andreas Bie?mann a ?crit : > Dear Minkyu Kang, > > Am 27.12.2010 um 11:27 schrieb Minkyu Kang: > >> 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 > > I doubt this is correct. In my investigations for 'NULL fixup' (-> see http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/89864/focus=89906) pointed out that only symbols in 'absolute fixup' loop could be 'NULL' if there is a not aliased/empty weakly linked symbol. I did never see a 'NULL' symbol for 'relative fixup' loop! > > Therefore I doubt it is correct to check the location at this place. Can you please give an example? > > regards > > Andreas Bie?mann Oops. Thanks Andreas for pointing this out. I second the question. Amicalement, -- Albert.