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

Scott Wood
2006-11-06T17:43:28Z

Wolfgang Denk wrote:
> In message <454BEF23.1020909@freescale.com> you wrote:
>
>>What about modifying the linker script so that all of bss is merged into
>>the image, i.e. treat it like 'data'?
>
>
> That would mean that you have to allocate flash memory for all this
> stuff, which is typically in the 100...150 kB range, i. e. you would
> double the memory footprint of U-Boot in flash memory.,

That seems rather ridiculously large... perhaps some of the larger
chunks of that could be dynamically allocated, rather than leaving a
giant welcome mat for bugs by executing C code before the BSS is cleared
(especially if, as it appears to be in this case, the compiler and/or
linker is putting things in the BSS even when explicitly initialized to
zero, rather than just left uninitialized)?

BTW, I'm only seeing about 19kB of BSS on an 8349EMDS build from the
current git head.

> No, this is NOT acceptable. Don't even think of it.

I don't think refusing to think about alternatives is conducive to good
software engineering.

-Scott