From: Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Why are some global vars part of the image, and some not?
Date: Mon, 06 Nov 2006 13:03:02 -0500 [thread overview]
Message-ID: <454F78D6.6020805@smiths-aerospace.com> (raw)
In-Reply-To: <454F7440.5030709@freescale.com>
Scott Wood wrote:
> 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
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. The stuff you
are doing is very early initialization - using I2C to read SPD, which is
before you even _have_ a normal bss because you don't even have your
SDRAM active at this point.
Welcome to the Wacky World of Embedded where you must do everything
yourself, and the world is populated with very sharp objects waiting to
nail you if you do anything wrong.
gvb
next prev parent reply other threads:[~2006-11-06 18:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 21:58 [U-Boot-Users] Why are some global vars part of the image, and some not? Timur Tabi
2006-11-03 22:19 ` Timur Tabi
2006-11-03 23:47 ` Wolfgang Denk
2006-11-04 0:09 ` Timur Tabi
2006-11-04 0:33 ` Wolfgang Denk
2006-11-03 23:44 ` Wolfgang Denk
2006-11-04 0:07 ` Timur Tabi
2006-11-04 0:31 ` Wolfgang Denk
2006-11-04 1:38 ` Timur Tabi
2006-11-04 2:04 ` Wolfgang Denk
2006-11-06 17:43 ` Scott Wood
2006-11-06 18:03 ` Jerry Van Baren [this message]
2006-11-06 18:08 ` Timur Tabi
2006-11-06 18:48 ` Jerry Van Baren
2006-11-06 18:56 ` Scott Wood
2006-11-06 19:06 ` Jerry Van Baren
2006-11-06 19:46 ` Scott Wood
2006-11-06 19:54 ` Timur Tabi
2006-11-06 20:13 ` Jerry Van Baren
2006-11-06 20:21 ` Timur Tabi
2006-11-06 20:44 ` Wolfgang Denk
2006-11-06 20:35 ` Tolunay Orkun
2006-11-06 20:29 ` Wolfgang Denk
2006-11-06 20:26 ` Wolfgang Denk
2006-11-06 20:48 ` Scott Wood
2006-11-06 21:15 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=454F78D6.6020805@smiths-aerospace.com \
--to=gerald.vanbaren@smiths-aerospace.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox