From: Wolfgang Denk <wd@denx.de>
To: Darin.Johnson@nokia.com
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: embedded gcc PPC toolchain questions
Date: Fri, 30 May 2003 09:41:17 +0200 [thread overview]
Message-ID: <20030530074122.BAD54C5492@atlas.denx.de> (raw)
In-Reply-To: Your message of "Fri, 30 May 2003 00:11:37 PDT." <F0B628F30F48064289D8CCC1EE21B7A80C4884@mvebe001.americas.nokia.com>
In message <F0B628F30F48064289D8CCC1EE21B7A80C4884@mvebe001.americas.nokia.com> you wrote:
> > Actually it should be no big surprise. I think every (?) standard
> > conforming C compiler will put uninitialized data into the BSS
> > segment (usually .bss in the linker scripts).
>
> Is BSS, or sections, a part of the C standard? Lots of data ends
> up in .sbss.
No. The C standard does not mention BSS or other linker sections. But
it contains requirements that may be (and often are) implemented
using such sections, for example:
All objects with static storage duration shall be initialized
(set to their initial values) before program startup.
in detail:
6.2.4 Storage durations of objects
...
3 An object whose identifier is declared with external or
internal linkage, or with the storage-class specifier
static has static storage duration. Its lifetime is the
entire execution of the program and its stored value is
initialized only once, prior to program startup.
...
... If an object that has static storage duration is not
initialized explicitly, then:
- if it has pointer type, it is initialized to a null pointer;
- if it has arithmetic type, it is initialized to (positive
or unsigned) zero;
- if it is an aggregate, every member is initialized
(recursively) according to these rules;
- if it is a union, the first named member is initialized
(recursively) according to these rules.
...
One method to implement this is to put uninitialized (or better: not
explicitly initialized) static data into a BSS segment, which will be
cleared (set to zero) befor estarting the program.
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
Remember that Beethoven wrote his first symphony in C ...
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next parent reply other threads:[~2003-05-30 7:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <F0B628F30F48064289D8CCC1EE21B7A80C4884@mvebe001.americas.nokia.com>
2003-05-30 7:41 ` Wolfgang Denk [this message]
[not found] <5.1.0.14.2.20030529125224.03782278@falcon.si.com>
2003-05-29 18:56 ` embedded gcc PPC toolchain questions Ron Flory
2003-05-29 20:21 ` Wolfgang Denk
2000-10-19 22:47 linux-embedded: smallest kernel for 2.4.0-test9 Brendan J Simon
2000-10-20 2:07 ` Dan Malek
2003-05-29 15:38 ` embedded gcc PPC toolchain questions Ron Flory
2003-05-29 16:22 ` Wolfgang Denk
2003-06-02 6:26 ` Erik Christiansen
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=20030530074122.BAD54C5492@atlas.denx.de \
--to=wd@denx.de \
--cc=Darin.Johnson@nokia.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
/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;
as well as URLs for NNTP newsgroup(s).