[U-Boot] Most ARM CPU's have buggy clear_bss?

Albert ARIBAUD albert.aribaud at free.fr
Fri Oct 29 15:37:42 CEST 2010


Le 29/10/2010 14:31, Alexander Holler a écrit :

>> Hmm... What do you mean by "a non relocated BSS ins't cleared" ? AFAICT,
>> the start.S code clears the relocated BSS. Are we in a case where you
>> prevent part of the relocation process, such as by using
>> CONFIG_SKIP_RELOCATE_UBOOT?
>
> The (wrong, not relocated) location of nand_chip (building without
> -fPIC) is inside the BSS before relocation through staŕt.S. This part of
> RAM will not be cleared because it shouldn't be used.

Er... nand_chip is declared as static global uninitialized, which makes 
it normal that it goes to BSS, and also normal that it has no fixups 
applied, as relocation happens before BSS can be accessed, that is, at a 
time where BSS is still completely uninitialized. Relocations to BSS 
just don't make sense, they're done only to constant code (.text and 
.data) emitted by the compiler/linker.

So if you call nand_init to fill nand_chip before relocation, don't 
expect it to be fixed up during relocation and useable after. That 
simply is not possible.

>> Providing the location on the Net of the toolchains will be enough,
>> (along with which version of nand.c you're using if that matters).
>
> I'm using Gentoo where it's easy to swith the compiler (on a DockStar ~
> Sheevaplug = Kirkwood Feroceon 88FR131) to compile the current HEAD of
> the master

I'm sure it is, but it does not tell me where I can get these toolchains 
and test them :) (except for the ELDK one which I use routinely).

> Regards,
>
> Alexander

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list