3.3 problem of -fzero-initialized-in-bss w/-ffreestanding
Segher Boessenkool
segher@koffie.nl
Wed Jul 16 01:44:00 GMT 2003
Geoff Keating wrote:
> Um, GCC already assumes that it happens before any code is run. When
> does your system do it?
>
> I don't think this is an appropriate thing for -ffreestanding.
> Non-hosted environments must still provide all the support
> infrastructure that hosted ones do, with the exception of certain
> headers and library routines.
C99 also specifies it should happen before any code is run:
From 5.1.2:
Two execution environments are defined: freestanding
and hosted. In both cases, program startup occurs when
a designated C function is called by the execution
environment. All objects in static storage shall be
initialized (set to their initial values) before program
startup.
Segher
More information about the Gcc
mailing list