• Aucun résultat trouvé

Functional Aspects of the Collector

Dans le document System Volume (Page 59-62)

MAIN ELl

2.2.3. Functional Aspects of the Collector

After the Collector has interpreted the parameters of the @MAP control statement (see 2.2.1) and the parameters of the Collector directives (see 2.2.2), there remains the combining of the relocatable elements into a relocatable or absolute element and the insertion of the final element into the program file to complete the collection process.

2.2.3. 1. Collector-Produced Relocatable Elements

Although the Collector is generally used to produce an absolute element, a relocatable element can be produced by specifying the R option on the @MAP control statement. All indicated relocatable elements are merged into a single element and only the external definitions specified in the DEF directive are retained. All other external definitions are submerged in the new relocatable element.

The R option is used most often when the user wants to include a relocatable element more than once in an absolute element. Initially, an R option collection is performed. This combines the desired element with a specified set of relocatable elements. As long as no external definitions within the element are specified on the DEF directive, the desired element is submerged into the newly-created relocatable element. The original relocatable element and the newly-created relocatable element in which it has been submerged can both be collected in a single absolute element. Relocatable elements in SYS$*RLlB$ are not implicitly included in an R option collection. Location counter specifiction is preserved, I.e., information contained in location counter n for all input RB's is placed under location counter n of the output RB.

Only the following directives may be specified with an R option collection. All others produce a diagnostic message and the collection continues.

TYPE

4 144 31

I

SPERRY UNIVAC 1100 Series Executive

I I

2 31

up~u~~

__

~

____________ V_o_l_u_m_e __ 3_S_y_s_t_e_m __ P_ro_c_e_s_s_o_r_s ______________________

L_UP_D_AT_E_L~

___ EL ____

~_AA_G_E_-

_____ _

1. Finding the files that were specified in the Collector directives (see 2.2.2).

2. Finding within these files the elements that have been specifically named on IN directives (seEt 2.2.2.1) or that contain entry points which satisfy the undefined symbols.

Element~t to be in(~luded in the collection may have been specified on IN directives (see 2.2.2.1) either with or without the filenames in which those elements appear. For those elements with a filename present Ion the IN directive, the Collector immediately references that file, finds the element, and proceSSEIS the pr,eamble of the element. After the preamble of a relocatable element has been processed, the te)Ct (instructions and data) of the relocatable element becomes part of the final output

eh~rnent.

If a @PREP (see 4.2.11) of TPF$. has not occurred, all relocatable elements in TPF$. are tentatively included in the c()lIection unless specifically excluded via the NOT directive (see 2.2.2.2). After all elements for a collection have been found, any nonreferenced element that was tentatively included from TPF$ is eliminated from the collection.

If a @PREP of TPF$. did occur, an element from TPF$, is included only if it is named on an IN directive or if one of its external definitions satisfies an undefined reference from another element included in the collection. When a @PREP of TPF$. has occurred, TPF$. is always the first file searched when attempting to locate elements named without a filename and elements with external definitions

satisfyin~~ undefined references.

The situcltion ma" arise where the user wants to implicitly include elements from a file other than TPF$, having entry point names or element names which duplicate entry point or element names in TPF$. Since TPF$ is searched prior to searching other files, the elements from TPF$. are included instead ()f the desired elements which are in other files.

Thereforle, if duplicates of element names and external definitions are present and those in TPF$. are not wanted in the collection, a @PREP of TPF$. is needed to prevent automatic inclusion of the TPF$.

elements;. It is also necessary to specifically IN by filename and element name any elements from other filEtS which have element names or external dlefinitions duplicated by TPF$. elements.

For thosiB elements without a filename on the IN directive, the Collector searches files for these elements; in the following order:

1. The Tempor,ary Program File (TPF$)

2. Use'r-defined files that were indicated by the LIB directive (see 2.2.2.3) 3. The System Relocatable Library (SYS$*RLlB$)

In an attEtmpt to satisfy all undefined references in the collection, the Collector searches the specified files for E~lements that have entry point names that c()rrespond to the symbol names appearing in the Collector created UNDE table (see 2.2.3.3). The UNDE table contains all the symbols that are present in the undefined symbol tables of the processed element preambles. When an element is found with an entry point name corresponding to a symbol name in the UNDE table, the preamble of that element is proce!ised and the now defined symbol is removed from the UNDE table. The order of search for undefined symbols is:

1. The' Temporary Program File (TPF$)

2. USEtr-defined files defined by the LIB directive (see 2.2.2.3) and which were previously @ PREPed 3. ThEI System Relocatable Library (SYS$*RLlB$)

4144.31 UP-NUMBER

SPERRY UNIVAC 1100 Series Executive

Volume 3 System Processors UPDATE LEVEL

2-32 PAGE

In a bank-implied collection, the included elements are placed in the instruction and data areas of the final absolute element. Odd numbered location counters of an element ar~ assigned to the instruction area. Even numbered location counters and common blocks are assigned to the data area.

See 2.2.2.1 and 2.2.4.6 for information on specific placement of common blocks.

See 2.2.5.6 and 2.2.5.7 for determining element inclusion and placement in a bank-named colle.ction.

The most efficient collection results when every element desired in the collection is explicitly named, including filenames; this eliminates @PREP requirements and library searches.

2.2.3.3. Processing Element Preambles

An element preamble is attached to every relocatable element created by the language processors and the Collector. The element preamble provides information which is needed when collecting relocatable elements to form an absolute or relocatable element. This information includes:

• The definition and location of each externally-defined name (entry point) in the element

• The length in words, under each location counter in the element

• The table of the undefined symbols appearing in the element

• Common blocks in the element When the preamble is processed:

• The entry points in the element are added to the Collector entry point table (EP table).

• Undefined symbols appearing in the element which have no corresponding entry in the EP table are listed in the UNDE table.

• Undefined symbols in the element which have a corresponding name to an entry point in another element are linked to the EP table.

Symbols are removed from the UNDE table as corresponding entry point names are found. Newly encountered undefined symbol names are added at the end of the UNDE table.

2.2.3.4. Instruction a:nd Data Area

This section applies primarily to bank-implied collections. See 2.2.5 for bank-named collection considerations.

Every program containing segments in addition to the main segment always has a D-bank. If there is no program data in the D-bank, then it contains at least a segment load table. The segment load table contains an entry with information describing every segment of the program. It is located preceding the user's main segment D-bank. Since the segment load table has no main storage protection, special care has to be taken not to destroy its information.

The program's data, when it exists, is located after the segment load table and any other Collector-produced tables, such as the ENTRY$, COMMN$, XREF$, and indirect load table.

The first address of the I-bank (instruction area) is assigned 01000. The starting address of the D-bank (data area) is dependent upon the size of the I-bank, the possible use of the assembler SETMIN directive, the total program size, and the options specified on the @MAP control statement. The first

4144,,31

I

SPERRY UNIVAC 1100 Series Executive

I I

2 33

UP-NUMBER

~,

_ _ _ _ _ _ _ V_o_l_u_m_e_3_S_y_st_e_m_P_r_o_c_e_s_s_o_rs _ _ _ _ _ _ _ _ _ _ _ --L_U_PD_A_TE_l_EV_E_l _ _ L.P_A_G_E -_ _ _

address of the O-bank, however, is always a multiple of 0 1 000 and is usually given the value 040000.

Odld numbered location counters are assigned to the I-bank; even numbered location counters and common blocks are assigned to the D-bank.

The user program can reference the first and last I-bank and the first and last D-bank addresses by the symbols: FRSTI$, LASTI$, FRSTD$, and LASTD$, respectively. The Collector replaces these symbols with the actual assigned address values.

An unnamed common block (Le., blank common), if required in the program, is attached to the main segment under the name BLANK$COMMON. It may be positioned in another segment by an IN BLANK$COMMON directive.

Named common blocks (if not named in an IN directive) are attached to the segment which is located at the common point in the paths to the main segment of all segments referencing it.

2.2.3.5. Collecting Reentrant Processors

In creating reentrant processors it is not only more efficient to explicitly name all elements including their filenames but it is also extremely ~dvisable. The nature of reentrant processors dictates that from one colle!ction to another all elements be located in the same relative position within the absolute element. This can only be ensured by explicitly including all elements in every collection of the absolute element. (See 2.4 for reentrant processor preparation.)

Dans le document System Volume (Page 59-62)