
Hi,
u-boot's bootelf clears (memset to 0) sections of SHT_NOBITS type. This covers .bss sections - however, it might also includes other sections, not expected to be cleared as per some users expectations (stacks, for example).
I am beginning to wonder if this behavior is correct/desired: if one tries to bootelf an ELF file which happens to resizde somewhere inside the .bss section, or some other data section of the loaded code, bootelf clears it (or part of it...) while loading, corrupting the code to be loaded.
AFAIK, .bss is normally zeroed out in crt0 (or equivalent), so there is no need (?) to zero it in bootelf. Bootelf may also defer all such actions (clearing section) to the end of the loading process.
Please feel free to correct me I I am wrong...
Thanks,
Baruch Cochavy