HP OpenVMS Systems Documentation

Content starts here

OpenVMS Linker Utility Manual


Previous Contents Index

B.3.1.2 Program-Section-Definition-in-Shareable-Image Subrecord (GSD$C_SPSC, EGSD$C_SPSC64)

This subrecord is reserved to the linker. It is generated in the GST when a program section is made universal with the SYMBOL_VECTOR keyword PSECT. When a main image links against a shareable image that contains these special universal program sections, the linker matches program sections from the main image to those in the shareable image and overlays them. The overlay is done only if the program sections have the same name, the attributes EGSY$V_OVR, EGSY$V_REL, and EGSY$V_GBL, and the same allocation. References to the program section in the main image are fixed up and thereby converted to references to the corresponding program section in the shareable image.

Shareable program sections have indexes, but are never referenced by symbol definitions. All symbol definitions in the GST point to an absolute program section, regardless of whether they are relocatable, that is, regardless of whether the EGSY$V_REL bit is set or clear.

Figure B-4 depicts the format of a definition subrecord, followed by a short description of each field. The EGSD$C_SPSC64 subrecord differs from GSD$C_SPSC only in that the image offset of the psect is a quadword rather than a longword. It has the same format shown in Figure B-4, with the name prefix ESGPS64$ rather than ESGPS$. EGSD$C_SPSC64 is used only if the offset is too large to fit in the 32-bit ESGPS$L_BASE field, and ESGPS64$Q_BASE must be used instead.

Figure B-4 GSD Subrecord for a Shareable Image Program Section Definition


GSD SUBRECORD TYPE Name: ESGPS$W_GSDTYP
  Length: 2 bytes

GSD type is EGSD$C_SPSC.

GSD SUBRECORD SIZE Name: ESGPS$W_SIZE
  Length: 2 bytes

This field contains the size of the entire subrecord, including the preceding type field and any padding used to quadword-align the following record.

PSECT ALIGNMENT Name: ESGPS$B_ALIGN
  Length: 1 byte

This field specifies the virtual address boundary at which the program section is placed. The alignment for the entire program section is the largest one specified by any of its contributions. Valid values for this field are 0 to 16.

ALIGNMENT BYTE Name: ESGPS$B_TEMP
  Length: 1 byte

Field alignment byte. Must be 0.

FLAGS Name: ESGPS$W_FLAGS
  Length: 2 bytes

This field is a word-length bit field, each bit indicating (when set) that the program section has the corresponding attribute. The next table lists the numbers, names, and corresponding meanings of each bit in the field.

Bit Name Meaning if Set
0 ESGPS$V_PIC Reserved, must be 1.
1 ESGPS$V_LIB Reserved, must be 0.
2 ESGPS$V_OVR Always set. Even if the contributions to this program section were concatenated, this attribute is set on the GST entry for the universal program section definition.
3 ESGPS$V_REL Program section is relocatable. Must be 1.
4 ESGPS$V_GBL Program section is global. Must be 1.
5 ESGPS$V_SHR Program section is shareable between two or more active processes. Propagated from the contributing psects.
6 ESGPS$V_EXE Reserved, must be 0.
7 ESGPS$V_RD Reserved, must be 0.
8 ESGPS$V_WRT Program section is writable. Propagated from the contributing psects.
9 ESGPS$V_VEC Reserved, must be 0.
10 ESGPS$V_NOMOD Reserved, must be 0.
11 ESGPS$V_COM Reserved, must be 0.
12 ESGPS$V_ALLOC_64BIT Program section is to be allocated in 64-bit address space.
13--15   Reserved to Compaq.

ALLOCATION Name: ESGPS$L_ALLOC
  Length: 4 bytes

This field contains the length in bytes of this module's contribution to the program section. The value is always nonzero.

BASE Name: ESGPS$L_BASE
  Length: 4 bytes

This field contains a copy of the low-order longword of the second half of the symbol vector entry. It is the image offset of the program section. In EGSD$C_SPSC64 records, the base field ESGPS64$Q_BASE is 8 bytes in length.

VALUE Name: ESGPS$L_VALUE
  Length: 4 bytes

This field contains the offset into the symbol vector of an entry for this program section.

PSECT NAME LENGTH Name: ESGPS$B_NAMLNG
  Length: 1 byte

This field contains the length in bytes of the program section name.

PSECT NAME Name: ESGPS$T_NAME
  Length: Variable, 1 to 31 bytes

This field contains the name of the program section in ASCII format.

B.3.1.3 Standard Program Section Names and Attributes

Table B-7 describes the standard program section names and attributes used by the Alpha compilers provided by Compaq.

Table B-7 Standard Program Sections
Name Attributes Use
$ABS$ NOPIC CON ABS LCL SHR NOEXE NORD NOWRT Contains the absolute program section, which is used by global constants. It has no allocation. Note that the linker builds the global symbol table with an absolute program section named .$$ABS$$., which has the attributes PIC, LIB, and RD.
$BSS$ NOPIC CON REL LCL NOSHR NOEXE RD WRT NOMOD Contains unmodified data. Used to construct demand-zero image sections.
$CODE$ PIC CON REL LCL SHR EXE NORD NOWRT Contains executable instructions.
$DATA$ NOPIC CON REL LCL NOSHR NOEXE RD WRT [NOMOD] Contains read/write, statically initialized data.
$LINK$ NOPIC CON REL LCL NOSHR NOEXE RD NOWRT Contains linkage consisting of procedure descriptors, linkage pairs, and .ADDRESS references.
$LITERAL$ PIC CON REL LCL SHR NOEXE RD NOWRT Contains read-only literals.
Common Data NOPIC OVR REL GBL NOSHR NOEXE RD WRT [NOMOD] Contains common data. These psects are usually named after the variable they represent (for example, FORTRAN common blocks). They are no longer marked SHR by default, as on VAX systems.
$READONLY$ PIC CON REL LCL SHR NOEXE RD NOWRT Contains read-only data.

B.3.2 Global Symbol Specification Subrecords (EGSD$C_SYM, EGSD$C_SYMG)

The global symbol specification subrecords are used to describe the nature of a symbol (global or universal, relocatable or absolute) and how it is being used (definition or reference, weak or strong). This information is specified in the FLAGS field of the subrecord. Unlike the GSD$C_SYM record on VAX systems, this record type is also used to define procedures (by setting the EGSY$V_NORM bit in the FLAGS field). There is no Alpha object language equivalent to the GSD$C_EPM record type, which is used on VAX systems to define an entry point mask for a global procedure.

There are two formats for a global symbol specification subrecord: one for a symbol definition and one for a symbol reference. A symbol definition is indicated when the EGSY$V_DEF bit in the FLAGS field is set. A symbol reference is indicated when the EGSY$V_DEF bit is clear.

Section B.3.2.1 describes the format of the global symbol specification subrecord for symbol definitions; Section B.3.2.3 does the same for symbol references.

B.3.2.1 GSD Subrecord for a Global Symbol Definition (EGSD$C_SYM with EGSY$V_DEF Set)

Figure B-5 depicts a global symbol specification subrecord that defines data. Figure B-6 depicts a global symbol specification that defines a procedure. The structures of each of these definitions are identical and have the same names, but some of the fields are interpreted differently based on the setting of the EGSY$V_NORM bit in the EGSY$W_FLAGS field. The Alpha object language does not have a separate subrecord type for procedures (for example, the VAX entry-point-symbol-and-mask-definition [GSD$C_EPM] subrecord).

Figure B-5 GSD Subrecord for a Global Symbol Definition (Data)


Figure B-6 GSD Subrecord for a Global Symbol Definition (Procedure)


The following is a list of the fields in a global symbol definition subrecord. Fields that have different meanings depending on the value of the FLAGS field are noted.

GSD SUBRECORD TYPE Name: ESDF$W_GSDTYP
  Length: 2 bytes

This field redefines EGSY$W_GSDSIZ. GSD type is EGSD$C_SYM.

GSD SUBRECORD SIZE Name: ESDF$W_SIZE
  Length: 2 bytes

This field redefines EGSY$W_GSDSIZ. It is the size of the entire subrecord, including the preceding type field and any padding used to quadword align the following record.

DATA TYPE Name: ESDF$B_DATYP
  Length: 1 byte

This field redefines EGSY$B_DATYP. It contains the data type of the global symbol. The linker currently ignores this field.

ALIGNMENT BYTE Name: ESDF$B_TEMP
  Length: 1 byte

This field redefines EGSY$B_TEMP. Alignment field must be 0.

FLAGS Name: ESDF$W_FLAGS
  Length: 2 bytes

This field redefines EGSY$W_FLAGS. It is a 2-byte bit field, but only bits 0 through 6 are used. The following table lists the numbers, names, and meanings of each bit in the field:

Bit Name Meaning
0 EGSY$V_WEAK When this bit is set, a weak symbol definition or reference is indicated; when clear, a strong symbol definition or reference.
1 EGSY$V_DEF This bit is set for a symbol definition.
2 EGSY$V_UNI Reserved, must be 0.
3 EGSY$V_REL When this bit is set, the symbol is defined as relocatable; when clear, as absolute. When it is relocated, the value of a relocatable symbol is augmented by the base address of the module's contribution to the program section.
4 EGSY$V_COMM Conditional Symbol Definition. If set, then EGSY$V_REL and EGSY$V_WEAK must be set, and the program section that contains the storage for the symbol must have EGPS$V_COM set.
5 EGSY$V_VECEP Reserved, must be 0.
6 EGSY$V_NORM Indicates Normal Procedure Definition. If set, then EGSY$V_REL must be set.
7 EGSY$V_QUAD_VAL This bit is set for global symbols whose values exceed 32 bits.
8--15   Reserved to Compaq.

VALUE Name: ESDF$L_VALUE
  Length: 4 bytes

This field contains the value assigned to the symbol by the language processor. If the EGSY$V_NORM bit is set, the value of this field is the offset into the program section (indicated in ESDF$L_PSINDX) of the procedure descriptor.

PROCEDURE ENTRY POINT OFFSET Name: ESDF$L_CODE_ADDRESS
  Length: 4 bytes

If the EGSY$V_NORM bit is set, the value in this field is the offset into the program section (indicated by ESDF$L_CA_PSINDX) of the entry point of the procedure. If the EGSY$V_NORM bit is clear, this field must be 0.

PROCEDURE ENTRY POINT PSECT INDEX Name: ESDF$L_CA_PSINDX
  Length: 4 bytes

If the EGSY$V_NORM bit is set, the value in this field contains the program section index of the program section that contains the code address. If the EGSY$V_NORM bit is clear, this field must be 0.

PSECT INDEX Name: ESDF$L_PSINDX
  Length: 4 bytes

This field contains the program section index, described in Section B.3.1. If EGSY$V_REL is set, the value in this field identifies a relocatable program section (one with EGPS$V_REL set) that contains the storage for the data or procedure descriptor. If the EGSY$V_REL bit is clear (the symbol is a constant), the PSECT INDEX must point to an absolute program section (one with EGPS$V_REL clear).

SYMBOL NAME LENGTH Name: ESDF$B_NAMLNG
  Length: 1 byte

This field contains the length in bytes of the symbol name.

SYMBOL NAME Name: ESDF$T_NAME
  Length: Variable, 1 to 64 bytes

This field contains the symbol name in ASCII format.

B.3.2.2 GSD Subrecord for a Universal Symbol Definition (EGSD$C_SYMG)

This record is reserved for use by the linker. It is used solely in global symbol tables in shareable images and global symbol table files (.STB) generated by the linker. This record type is not used in compiler-generated symbol table files. Figure B-7 depicts the universal symbol specification subrecord for a data definition.

Figure B-7 GSD Subrecords for Universal Data Definition


Figure B-8 depicts the universal symbol specification subrecord for a procedure definition.

Figure B-8 GSD Subrecord for a Universal Procedure Definition


The following is a list of the fields in a universal symbol definition subrecord.

GSD SUBRECORD TYPE Name: EGST$W_GSDTYP
  Length: 2 bytes

This field redefines EGSY$W_GSDTYP. The GSD type is EGSD$C_SYMG.

GSD SUBRECORD SIZE Name: EGST$W_SIZE
  Length: 2 bytes

This field redefines EGSY$W_GSDSIZ. It is the size of the entire subrecord, including the preceding type field and any padding used to quadword align the following record.

DATA TYPE Name: EGST$B_DATYP
  Length: 1 byte

This field redefines EGSY$B_DATYP. Reserved, must be 0.

ALIGNMENT BYTE Name: EGST$B_TEMP
  Length: 1 byte

This field redefines EGSY$B_TEMP. Used for alignment, must be 0.

FLAGS Name: EGST$W_FLAGS
  Length: 2 bytes

This field redefines EGSY$W_FLAGS. It is a 2-byte bit field, whose bits describe the universal symbol.

Bit Name Meaning
0 EGSY$V_WEAK Reserved, must be 0.
1 EGSY$V_DEF Indicates definition, must be 1.
2 EGSY$V_UNI Indicates universal symbol, must be 1.
3 EGSY$V_REL When this bit is set, the symbol is defined as relocatable; when clear, it is absolute. EGSY$V_REL should be set if the symbol identifies a procedure (EGSY$V_NORM is set) or if the symbol identifies a relocatable data cell. If the symbol is a constant, the EGSY$V_REL bit should be clear.
4 EGSY$V_VECEP Reserved, must be 0.
5 EGSY$V_COMM Reserved, must be 0.
6 EGSY$V_NORM Normal Procedure Definition.
7 EGSY$V_QUAD_VAL This bit is set for global symbols whose values exceed 32 bits.
8--15   Reserved to Compaq.

VALUE Name: EGST$L_VALUE
  Length: 4 bytes

This field contains the offset into the symbol vector of the symbol vector entry for this symbol. If the symbol is a constant, the VALUE field still contains an offset into the symbol vector; the constant value resides in the symbol vector itself. External references to a constant symbol will receive fix-ups. Unlike VAX systems, there are no link-time constants on Alpha systems.

FIRST HALF OF SYMBOL VECTOR ENTRY Name: EGST$L_LP_1
  Length: 4 bytes

This field contains the low-order 32 bits of the first quadword of the symbol's entry in the symbol vector. If the EGSY$V_NORM bit is set, this is the offset into the image of the procedure entry point. Otherwise, this field contains zeros.

SECOND HALF OF SYMBOL VECTOR ENTRY Name: EGST$L_LP_2
  Length: 4 bytes

This field contains the low-order 32 bits of the second quadword of the symbol's entry in the symbol vector. If the EGSY$V_REL bit is clear, the symbol is a constant and this field contains the constant value. If EGSY$V_REL bit is set and the EGSY$V_NORM bit is clear, this field contains the image offset of data. When the EGSY$V_NORM bit is set, the GSD subrecord defines a procedure and the field contains the image offset of a procedure descriptor.

PSECT INDEX Name: EGST$L_PSINDX
  Length: 4 bytes

This must be the index of an absolute psect. Normally there is only one absolute psect, named ".$$ABS$$.", and its index is 0.

SYMBOL NAME LENGTH Name: EGST$B_NAMLNG
  Length: 1 byte

This field contains the length in bytes of the symbol name.

SYMBOL NAME Name: EGST$T_NAME
  Length: Variable, 1 to 64 bytes

This field contains the symbol name in ASCII format.


Previous Next Contents Index