Re: Automaticly eliminating redundant zero initialisers

From: Frank Moehle (Frank.Moehle@Informatik.Uni-Oldenburg.DE)
Date: Tue May 02 2000 - 05:04:37 EST


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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:10 EST