The PSECT directive modifies several attributes of a common block. It takes the following form:
cDEC$ PSECT /common-name/ attr [,attr] . . .
Specifies alignment for the common block; on VAX processors, val must be a constant ranging from 0 through 9; on Alpha processors, 0 through 16.
The specified number is interpreted as a power of 2. The value of the expression is the alignment in bytes: a value of zero indicates byte alignment; a value of 9 (on VAX processors) or 16 (on Alpha processors) specifies page alignment.
Specifies global scope.
Specifies local scope. This keyword is opposite to GBL and cannot appear with it.
Determines whether the contents of a common block can be shared by more than one process.
Determines whether the contents of a common block can be modified during program execution.
Global or local scope is significant for an image that has more than one cluster. The attribute determines whether program sections with the same name but from different modules in different clusters are finally placed in separate clusters (local scope) or in the same cluster (global scope).
If one program unit changes one or more attributes, all other units that reference the common block must also change those attributes in the same way.
Default attributes apply if you do not modify them with a PSECT directive. Table 11-1 lists the default attributes of common blocks and how they can be modified by PSECT.
Common Block Default Attributes | PSECT Modification |
---|---|
Relocatable | None |
Overlaid | None |
Global Scope | Global (GBL) or local (LCL) scope |
Not executable | None |
Writable | Writable or not writable ([NO]WRT) |
Readable | None |
No protection | None |
On VAX processors: | |
Shareable | Shareable or not shareable ([NO]SHR) |
Position independent | None |
Quadword alignment[1] (3) | 0 through 9 (ALIGN=val) |
On Alpha processors: | |
Not shareable | Shareable or not shareable ([NO]SHR) |
Position dependent | None |
Octaword alignment[2] (4) | 0 through 16 (ALIGN=val) |
[1] An address that is an integral multiple of 8.
|
For details on the default attributes of common blocks: on OpenVMS
systems, see the OpenVMS
Linker Utility Manual; on Tru64 UNIX systems, see
ld(1)
.