This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: compile error when using newer version ecos configuration tool

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]