[U-Boot-Users] Why are some global vars part of the image, and some not?

Tolunay Orkun
2006-11-06T20:35:44Z

Scott Wood wrote:

> The BSS is purely an optimization; besides increasing flash footprint
> somewhat, removing it should not change anything except for code that
> was already broken.

But that increase in size can be important. Besides after relocation
from ROM to RAM the area will not be used. I personally would rather not
increase the size of image to handle a limited number of special cases
where this initialization is needed prior to relocation to RAM. You can
handle such special cases by instructing the variable to be placed on
"data" section (like Timur did). Perhaps a macro could be defined to
make it more readable and documentation/faq would take care of education.

Tolunay