
Dear Tom,
In message 20130403164215.GK7035@bill-the-cat you wrote:
... except, as I said above, at this point your code should not write at all, be int in BSS or data, until the C environment is set up. So...
But we have to save this ROM-passed information before we overwrite it ourselves (by accident or purpose).
Thete are two official places for data storage before the full C runtime environment is available: the stack, and the "global data" structure.
But I think, and need to re-read this thread a bit more, part of the solution is to rename jump_to_image_no_args as jump_to_image_uboot, keep it __weak and provide one that deals with this (and perhaps more cleanly deals with VIRTIO/ZEBU image_entry). And after that we can talk about moving things that can't be in the BSS out of the data section and into another section.
Adding another section makes things more complicated, but not really better. If you can provide writable storage, then you could also use it in a more regular way, say for a writable data segment, or bigger stack, or malloc space, or ... so it is generally useful instead of only this special case here.
Best regards,
Wolfgang Denk