[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Build environment bug: 675125


On Tue, 19 Jun 2012 15:11:33 -0700
Josh Triplett <josh@joshtriplett.org> wrote:

> Variables in the .bss section will by definition get initialized to 0.
> For example, a C variable defined as "static typename varname;" must
> get initialized to 0, and the compiler and linker will stick it in
> the .bss section expecting that it will end up with a value of 0 at
> runtime. That represents a defined property of the standard, not an
> implementation quirk.  So, the .bss section must get initialized to 0,
> not to random values, whether in a debug build or not.

Oh, yes, indeed, though I see no such requirement to put initialise
non-static variables in the standard, so static variables could just go
to .data section, leaving .bss truly uninitialised.

WBR, Andrew

Attachment: signature.asc
Description: PGP signature

Reply to: