[U-Boot] arm: wrong Relocation and not cleared BSS

Alexander Holler holler at ahsoftware.de
Sat Oct 30 15:45:50 CEST 2010


Hello,

Am 30.10.2010 15:36, schrieb Albert ARIBAUD:

>> The code is moved upwards, but that code still uses the data at d.
>> This results another problem: Some parts in the code are assuming that d
>> is cleared (set to zero in start.S). But what start.S does it to clear
>> the new location (z in the picture below).
>
> Wait a minute. No parts of the code assume BSS is *cleared*, or at least
> no pat of the should *should ever* assume that. BSS is not "zeroed
> data", it is "uninitialized data".

Thats true for normal C, but I assume that is not true for u-boot.

This reminds me on some problems I've had long long time ago, with 
switching from debug to optimized code using vc++. I don't know if it is 
still true (>10a ago), but in those days, vc++ had preset all not 
initialized data with zero when optimization was turned off.

If the code in u-boot would not assume that bss is zero, I don't 
understand why clear_bss in start.S exists.

Regards,

Alexander


More information about the U-Boot mailing list