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

Andreas Bießmann andreas.devel at googlemail.com
Sat Jan 8 11:32:38 CET 2011


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 <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

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




More information about the U-Boot mailing list