2.4 Program Image Layout

The Windows NT for Alpha Systems Calling Standard does not define many aspects of an executable image. However, there is one basic concept that is defined to permit optimal access to static data.

A hardware architecture that has the property that instructions cannot contain full virtual addresses is sometimes referred to as a base register architecture. The Alpha architecture is such an architecture. In a base register architecture, normal memory references within a limited range from a given address are expressed by using displacements relative to the contents of some register that contains that address (usually referred to as a base register). Base registers for external program segments, either data or code, are usually loaded indirectly through a program segment of address constants.

To optimize this base register access method, this standard allows the main (static) image of an executable program to have a single global storage region that is addressable by the GP register. Together, the linker and the compilers arrange that various static data is collected together into a single such region that is shared across all procedures in the main image.

During the compilation process a compiler generates object language to designate data as belonging in the global segment. The linker pools these contributions to form the segments; in particular, address constants, literals, and external storage from multiple compilations can often be combined. The total contributions of all modules of the main image must not exceed 64K bytes of contributions after pooling.

For dynamic-link libraries, no shared global segment is provided. A separate compilation mode is required that neither makes contributions to a global segment nor assumes the availability of a global pointer for addressing. (In this latter compilation mode, the GP must not be used in any way.)