From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 06 Nov 2006 11:43:28 -0600 Subject: [U-Boot-Users] Why are some global vars part of the image, and some not? In-Reply-To: <20061104020417.69640352658@atlas.denx.de> References: <20061104020417.69640352658@atlas.denx.de> Message-ID: <454F7440.5030709@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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