Re: question regarding bss section

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

 



In message <20031027190829.GB24946@linux-mips.org> 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
zero.

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: wd@denx.de
Quantum particles: The dreams that stuff is made of.


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux