Re: Automaticly eliminating redundant zero initialisers

From: David Forrest (drf5n@mug.sys.virginia.edu)
Date: Mon May 01 2000 - 12:52:54 EST


I remember that initially BSS meant Bull-S___ Storage, and was
uninitiallized and in an indeterminate state. It should be initiallized
before reads, and should not be counted on to be anything: Cautious
programmers avoid using uninitialized variables, and good compilers warn
them if they do. If Linux has an initially zero storage space, it has
more overhead, and isn't quite the old BSS.

Dave.

On Mon, 1 May 2000, Russell King wrote:

> George Anzinger writes:
> > 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.
>
> The BSS is defined to be the segment which is filled with zeros. If you
> fill it with any other value at startup, any program that uses it will
> break. Therefore, you have two choices:
>
> 1. Have a BSS, and fill it with zeros, or
> 2. Don't have a BSS at all.
>
> In the age old days of Linux, option 2 was the one selected. Today, all
> Linux kernels have a BSS, and it is filled with zeros.
> _____
> |_____| ------------------------------------------------- ---+---+-
> | | Russell King rmk@arm.linux.org.uk --- ---
> | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
> | +-+-+ --- -+-
> / | THE developer of ARM Linux |+| /|\
> / | | | --- |
> +-+-+ ------------------------------------------------- /\\\ |
>
> -
> 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/
>

-- 
 Dave Forrest                                dforrest@virginia.edu
 (804)296-7283h 924-3954w      http://mug.sys.virginia.edu/~drf5n/

- 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:08 EST