This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: compile error when using newer version ecos configuration tool
- To: "Trenton D. Adams" <tadams at theone dot dnsalias dot com>
- Subject: Re: [ECOS] compile error when using newer version ecos configuration tool
- From: "J. J. Farrell" <jjf at abaqos dot com>
- Date: Tue, 13 Nov 2001 15:54:25 -0800
- Cc: "'Andrew Lunn'" <andrew dot lunn at ascom dot ch>, "'eCos'" <ecos-discuss at sources dot redhat dot com>
- References: <20011113092807.Q15856@biferten.ma.tech.ascom.ch> <000c01c16c8c$b4d8c190$090110ac@TRENT>
[Get raw message]
On Tue, Nov 13, 2001 at 02:46:52PM -0700, Trenton D. Adams wrote:
>
> I think you're correct! Why because the -fno-common option to GCC
> specifies that it will allow uninitialized data to be put in the bss
> section. Which indicates to me that it's not normal for ELF.
>
> > From: Andrew Lunn [mailto:andrew.lunn@ascom.ch]
> >
> > It seems the ELF spec specifies the .bss section is initialized to
> > zero. Where as what you say about PE is that the contents are not
> > initialized. Something to remember when writing portable code!
I think you're misinterpreting things here. gcc can be configured
to output for any number of different assemblers and output formats,
and -fno-common is applicable to many of them - it has nothing in
particular to do with ELF.
-fno-common is concerned with controlling object linkage - whether
an external variable declared in more than one source file results
in a single object, or multiple objects with the same name. It has
nothing directly to do with initialization.
C global variables which are not explicitly initialized must be
initialized by the compiler/linker/loader as if 0 had been
assigned to them. This is often achieved by describing them in a
.bss section without any initialization, then having the loader
initialize the .bss section to 0 when it loads the program.