This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Automaticly eliminating redundant zero initialisers
- To: george at pioneer dot net, tigran at veritas dot com, linux-kernel at vger dot rutgers dot edu, gcc at gcc dot gnu dot org
- Subject: Re: Automaticly eliminating redundant zero initialisers
- From: "Frank Moehle" <Frank dot Moehle at Informatik dot Uni-Oldenburg dot DE>
- Date: Tue, 02 May 2000 12:04:37 +0200
- Organization: University of Oldenburg, Germany
> [ we want to eleminate zero initializers and
> put them into the .bss section ... ]
>Soon as you depend on this some OS dude will fill bss with -1s so he can
>tell what was used... or some such. Seems like a bad idea to depend on
>bss being anything at all.
>
>George
In fact, you can assume something if your system uses the "ELF" format
(which all unix flavours i know of do)
According to the ELF specs, Version 1.1,
the .bss section has a special interpretation:
" .bss This section holds uninitialized data that contribute to the
program's memory image. By definition, the system initializes the
data with zeros when the program begins to run. The section occupies
no file space, as indicated by the section type, SHT_NOBITS."
I don't know if newer specs exists, but it seems that any system that
uses ELF needs to guarantee this propertty.
regards,
Frank.
--
=======================================================================
Frank Moehle | Understanding is a
Work : Uni Oldenburg,Computer Architecture Group | three-edged sword.
Inhouse: frankm@haydn | (Vorlon saying)
DOMAIN : Frank.Moehle@Informatik.Uni-Oldenburg.DE +-------------------
-----------------------------------------------------------------------
**** Its how you DO it, not how you don't. ****