Reference Guide
42 Chapter 3
HP-UX Architecture Conventions
Subspaces
Subspaces
While a space is a fundamental concept of the architecture, a subspace is
just a logical subdivision of a space. The Assembler places the program's
code and data into subspaces within spaces. Each subspace belongs to
the space that was current when the subspace was first declared. The
linker groups subspaces into spaces as it builds an executable program
file. For more details see the ld(1) entry in the HP-UX Reference. When
the linker combines several relocatable files, it groups the subspaces
from each file by name, so that all subspaces with the same name are
placed contiguously in the program.
Attributes
Subspaces have several attributes. The alignment attribute specifies
what memory alignment (in bytes) is required in the virtual address
space. The alignment can be any power of two, from 1 through 4096,
inclusive. Typically, the alignment is 4 or 8 to specify that the beginning
of the subspace must be word or double-word aligned. Normally, the
alignment attribute is computed automatically by the Assembler from
the largest .ALIGN directive used within the subspace.
The quadrant attribute assigns the subspace to one of the four quadrants
of its space. On HP-UX systems, all subspaces in the code space must be
in quadrant 0, and all subspaces in the data space must be in quadrant
1.
The access rights attribute specifies the access rights that should be
given to each physical page in the subspace. On HP-UX systems, all
subspaces in the code space must have access rights of 0x2C (code page
executable at any privilege level). All subspaces in the data space must
have access rights of 0x1F (data page readable and writable at all
privilege levels).
The sort key attribute allows the programmer to control the placement of
a subspace relative to the other subspaces in its space. The linker places
subspaces with lower sort keys in front of subspaces with higher sort
keys.