Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Wolfgang Denk <wd@denx.de>
Cc: linux-mips@linux-mips.org
Subject: Re: question regarding bss section
Date: Tue, 28 Oct 2003 00:01:36 +0100	[thread overview]
Message-ID: <20031027230136.GA27764@linux-mips.org> (raw)
In-Reply-To: <20031027194920.8D301C59E4@atlas.denx.de>

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,
	SHT_NOBITS.

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

  Ralf

  reply	other threads:[~2003-10-27 23:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-27 17:44 question regarding bss section Teresa Tao
2003-10-27 17:44 ` Teresa Tao
2003-10-27 18:09 ` Ralf Baechle
2003-10-27 18:17   ` Wolfgang Denk
2003-10-27 19:08     ` Ralf Baechle
2003-10-27 19:49       ` Wolfgang Denk
2003-10-27 23:01         ` Ralf Baechle [this message]
2003-10-27 18:16 ` 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=20031027230136.GA27764@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=wd@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