[Top] [All Lists]

Re: question regarding bss section

To: Wolfgang Denk <>
Subject: Re: question regarding bss section
From: Ralf Baechle <>
Date: Tue, 28 Oct 2003 00:01:36 +0100
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
User-agent: Mutt/1.4.1i
On Mon, Oct 27, 2003 at 08:49:15PM +0100, Wolfgang Denk wrote:

> 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

C doesn't know about .bss at all - no single mentioning in the ISO C
standard.  But .bss is a section name used in the ELF binary format which
most Linux systems are using.  The gABI says defines .bss:

.bss    This section holds uninitialized data that contribute to the
        program s memory image. By definition, the system initializes
        the data with zeros when the program begins to run. The section
        occupies no file space, as indicated by the section type,

Certainly the term ``uninitialized'' isn't as precise as desirable but
that's the wording used in the relevant standard.


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