[Top] [All Lists]

Re: question regarding bss section

To: Ralf Baechle <>
Subject: Re: question regarding bss section
From: Wolfgang Denk <>
Date: Mon, 27 Oct 2003 20:49:15 +0100
In-reply-to: Your message of "Mon, 27 Oct 2003 20:08:29 +0100." <>
Original-recipient: rfc822;
In message <> you wrote:
> > > .bss is uninitialized.  Initialized data can't be in .bss.
> > 
> > No. BSS is initialized as zero.
> RTFM.  It's unitialized because not contained in the binaries.

When an application runs it will see the BSS space as initialized  as

In most implementations of ANSI C that I am aware of (including GCC /
glibc), the BSS segment will be used for uninitialized variables with
"static" storage  class.  Also,  I've  seen  some  compilers  to  put
variables eplicitly initialized to zero into the BSS segment, too. To
quote the C FAQ:

    Uninitialized variables with "static" duration (that is, those
    declared outside of functions, and those declared with the
    storage class static), are guaranteed to start out as zero, as if
    the programmer had typed "= 0". Therefore, such variables

Best regards,

Wolfgang Denk

Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email:
Quantum particles: The dreams that stuff is made of.

<Prev in Thread] Current Thread [Next in Thread>