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

Timur Tabi timur at freescale.com
Mon Nov 6 19:08:48 CET 2006


Jerry Van Baren wrote:

> You don't understand, u-boot _is_ what zeros bss so, until u-boot is 
> running enough to zero bss, bss will be random garbage. 

If BSS were merged into the DATA segment, then the compiler would be the one 
that zeros BSS.  Basically, BSS would go away, and all global variables 
(static or otherwise) would be placed into DATA.  They would be initialized to 
zeros by the compiler, and when the image is burned into flash, that image 
would have zeros in those memory locations.

This would also allow us to delete the BSS-initialization code in U-Boot.

I'm not advocating that we should implement this idea.  I just wanted to 
clarify things.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale




More information about the U-Boot mailing list