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: "'J. J. Farrell'" <jjf at abaqos dot com>
- Subject: RE: [ECOS] compile error when using newer version ecos configuration tool
- From: "Trenton D. Adams" <tadams at theone dot dnsalias dot com>
- Date: Tue, 13 Nov 2001 19:46:38 -0700
- Cc: "'Andrew Lunn'" <andrew dot lunn at ascom dot ch>, "'eCos'" <ecos-discuss at sources dot redhat dot com>
So, what you're saying is that BSS is infact for uninitialized
variables? Because of the fact that the BSS section is initialized to
0, the uninitialized variables become initialized?
> -----Original Message-----
> From: J. J. Farrell [mailto:jjf@abaqos.com]
> Sent: November 13, 2001 4:54 PM
> To: Trenton D. Adams
> Cc: 'Andrew Lunn'; 'eCos'
> Subject: Re: [ECOS] compile error when using newer version
> ecos configuration tool
>
>
> 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.
>