11.2.7 PSECT Directive

The PSECT directive modifies several attributes of a common block. It takes the following form:

cDEC$ PSECT /common-name/ attr [,attr] . . .
c
Is the letter or character that introduces the directive tag (see Section 11.1).
common-name
Is the name of the common block, preceded and followed by a slash (/).
attr
Is one of the following attributes:

  • ALIGN=val

    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.

  • GBL (VMS only)

    Specifies global scope.

  • LCL (VMS only)

    Specifies local scope. This keyword is opposite to GBL and cannot appear with it.

  • [NO]SHR (VMS only)

    Determines whether the contents of a common block can be shared by more than one process.

  • [NO]WRT (VMS only)

    Determines whether the contents of a common block can be modified during program execution.

Rules and Behavior

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.

Table 11-1 Common Block Default Attributes and PSECT Modification

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.
[2] An address that is an integral multiple of 16.

For More Information:

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) .


Previous Page Next Page Table of Contents