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

Albert ARIBAUD albert.aribaud at free.fr
Mon Jan 10 18:21:06 CET 2011


Le 10/01/2011 15:04, Minkyu Kang a écrit :

>>> How about lcd_setmem function?
>>> panel_info is located at bss area, but lcd_setmem access this structure.
>>> Is it illegal?
>>
>> This must not be done before relocation.
>
> No, please see 360 line of arch/arm/lib/board.c
> This function is called before relocation.

Then it cannot access panel_info, which is "not there yet" at the time 
lcd_setmem() executes.

You must either move the call to lcd_setmem() to after relocation, or 
find a way not to depend on BSS.

> And how about init_func_i2c()?
> This function is called twice, before the relocation and after relocation.
> When we use board_i2c_init function then, there is possibility that
> use symbols in bss because of this function is called after
> relocation.

If it is used both before and after relocation, then it has to respect 
the strictest case, which is before relocation, and not access BSS.

> If we ignore this exception, it will be a big constraint.
>
> btw, there are any side effects on my patch?
> I think.. It is just a little safety feature.

Regardless of the patch, if your code writes to panel_info or any other 
BSS variable before relocation it will trash the relocation tables that 
exist at BSS location at this point.

IOW, accessing BSS before relocation is forbidden, not just out of 
fancy, but for a serious reason.

> Thanks
> Minkyu Kang

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list