HP OpenVMS Systems Documentation |
OpenVMS Linker Utility Manual
A.3.1 Program Section Definition Subrecord (GSD$C_PSC)The linker assigns program sections an identifying index number as it encounters their respective GSD subrecords, that is, the GSD$C_PSC records. The linker assigns these numbers in sequential order, assigning 0 to the first program section it encounters, 1 to the second, and so on, up to the maximum allowable limit of 65,535 (216 --1) within any single object module. Program sections are referred to by other object language records by means of this program section index. For example, the global symbol specification subrecord (GSD$C_SYM) contains a field that specifies the program section index. This field is used to locate the program section containing a symbol definition. Also, TIR commands use the program section index. Of course, care is required to ensure that program sections are defined to the linker (and thus assigned an index) in proper order so that other object language records that reference a program section by means of the index are in fact referencing the correct program section. The following presents the name, symbolic representation, and length of each field in the program section definition subrecord. The listing includes a symbolic value or an explanation of the contents of the field, where appropriate. Note that the names of fields in this subrecord begin with GPS rather than PSC.
The GSD type is GSD$C_PSC.
This field specifies the virtual address boundary at which the program section is placed. Each module contributing to a particular program section may specify its own alignment unless the program section is overlaid, in which case each module must specify the same alignment. An overlaid program section is one in which the value of flag bit 2 (GPS$V_OVR) is not equal to 0. The contents of the alignment field is a number from 0 to 9, which is interpreted as a power of 2; the value of this expression is the alignment in bytes. The value 9 in the alignment field indicates alignment on page boundaries, which is the limit for program section alignment. Table A-2 illustrates some common alignment field values.
This field is a word-length bit field, each bit indicating (when set) that the program section has the corresponding attribute. (See Section 3.2 for a description of program section attributes.) The following table lists the numbers, names, and corresponding meanings of each bit in the field:
This field contains the length in bytes of this module's contribution to the program section. If the program section is absolute, the value of the allocation field must be zero.
This field contains the length in characters of the program section name.
This field contains the name of the program section in ASCII format.
The global symbol specification subrecord is 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. 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 bit 1 (GSY$V_DEF) in the FLAGS field is set, that is, when GSY$V_DEF = 1. A symbol reference is indicated when GSY$V_DEF = 0.
Section A.3.2.1 describes the format of the global symbol specification
subrecord for symbol definitions; Section A.3.2.2 does the same for
symbol references. Note that the PSECT INDEX and VALUE fields are
present only for symbol definitions, not for symbol references.
The following presents the name, symbolic representation, and length of each field in the global symbol specification subrecord for a symbol definition. The listing includes a symbolic value or an explanation of the contents of the field, where appropriate.
The GSD type is GSD$C_SYM.
This field describes the data type of the global symbol. The linker currently ignores this field.
This field is a 2-byte bit field, whose bits describe the strong global symbol. Only bits 0 through 3 are used. The following table lists the numbers, names, and meanings of each bit in the field:
This field contains the program section index, described in Section A.3.1. This field identifies the program section that contains the symbol definition. It may contain a number from 0 through 255 (28 --1).
This field contains the value assigned to the symbol by the language processor.
This field contains the length in characters of the symbol name.
This field contains the symbol name in ASCII format.
The following presents the name, symbolic representation, and length of each field in the global symbol specification subrecord for a symbol reference. The listing includes a symbolic value or an explanation of the contents of the field, where appropriate.
The GSD type is GSD$C_SYM.
This field describes the data type of a global symbol. The linker currently ignores this field.
This field is a 2-byte bit field, whose bits describe the global symbol. Only bits 0 through 3 are used. The following are the numbers, names, and corresponding meanings of each bit in the field:
This field contains the length in characters of the symbol name.
This field contains the symbol name in ASCII format.
The following presents the name, symbolic representation, and length of each field in the entry-point-symbol-and-mask-definition subrecord. The listing includes a symbolic value or an explanation of the contents of the field, where appropriate.
The GSD type is GSD$C_EPM.
This field describes the data type of a global symbol. The linker currently ignores this field.
This field is a 2-byte bit field, whose bits describe the strong global symbol. Only bits 0 through 3 are used. The following are the numbers, names, and corresponding meanings of each bit in the field:
This field contains the program section index, described in Section A.3.2. This field identifies the program section that contains the symbol definition. It may contain a number from 0 through 255 (28 --1).
This field contains the value assigned to the symbol by the language processor.
The point of entry to a procedure invoked by a CALLS or CALLG instruction has an entry mask. Transfer vectors to these procedures also use entry masks. The language processor uses a TIR command to direct the linker to insert the mask at the procedure entry point or at the transfer vector.
This field contains the length in characters of the symbol name.
This field contains the symbol name in ASCII format.
The following presents the name, symbolic representation, and length of each field in the procedure-with-formal-argument-definition subrecord. The listing includes a symbolic value or an explanation of the contents of the field, where appropriate.
The GSD type is GSD$C_PRO.
This field describes the data type of a global symbol. The linker currently ignores this field.
This field is a 2-byte bit field, whose bits describe the strong global symbol. Only bits 0 through 3 are used. The following are the numbers, names, and corresponding meanings of each bit in the field:
This field contains the program section index, described in Section A.3.2. This field identifies the program section that contains the symbol definition. It may contain a number from 0 through 255 (28 --1).
This field contains the value assigned to the symbol by the language processor.
The point of entry to a procedure invoked by a CALLS or CALLG instruction has an entry mask. Transfer vectors to these procedures also use entry masks. The language processor uses a TIR command to direct the linker to insert the mask at the procedure entry point or at the transfer vector.
This field contains the length in characters of the symbol name.
This field contains the symbol name in ASCII format.
This field specifies the minimum number of arguments required for a valid call to this procedure. Permissible values are 0 to 255. The number must include the function return value if it exists.
This field specifies the maximum number of arguments that may be included in a valid call to this procedure. Permissible values are 0 to 255. Note that the linker does not perform argument validation; however, it will issue a warning message if the value of MINIMUM ACTUAL ARGUMENTS is greater than the value of MAXIMUM ACTUAL ARGUMENTS.
This field specifies a single formal argument descriptor. There is a FORMAL ARG DESCRIPTOR field for each formal argument specified. This field contains three subfields; its format is displayed at the end of this section.
This field specifies the last (n) formal argument descriptor and is identical in format to previous formal argument descriptor fields. Note that if there is a function return value, this field specifies it. Each FORMAL ARG DESCRIPTOR field contains three subfields. The content and format are as follows:
This field is the argument validation control byte. Bits 0 and 1 together define the argument passing mechanism (ARG$V_PASSMECH). Bits 2 through 7 are ignored. There are four possible values for ARG$V_PASSMECH corresponding to the four possible values (0 through 3) resulting from the combination of the values of bits 0 and 1:
This field contains the length in bytes of the remainder of the argument descriptor. Permissible values are 0 through 255. Because the linker does not perform argument validation, it uses the value of this field only to determine how many subsequent bytes to ignore.
This field contains a detailed description of the argument. The linker currently ignores this field.
|