Douglas Sondak writes:
> Documentation for IBM XL Fortran says that *initialized* static and
> common variables are stored in "data" and that *uninitialized* static
> and common variables are stored in "bss." Does anyone know why
> initialized and uninitialized variables are handled differently? From
> a user standpoint, is there any reason to be concerned with
> differences between data and bss?
Yes. bss storage is represented in the executable image as simply a base
address and a length - the loader (or image activator or whatever) simply
creates the virtual memory of the correct size (and may zero it
automatically). "data" storage requires that every byte of the memory
layout be represented in the executable - this can lead to very large
executables and longer image activation times. Some operating systems
provide the ability for the linker to notice large contiguous zero pages and
convert them to "demand-zero" sections, but others do not.
In other words, if you have a 100MB array that's allocated in the "data"
section, it can increase your executable size by 100MB, whereas if it were
in the "bss" section, it would be just a dozen or so bytes of
representation.
Steve Lionel
Compaq and Intel Fortran Engineering
Intel Corporation
Nashua, NH
|