Hardware Reference
In-Depth Information
A procedure segment
The linkage segment
Invalid address
EARTH
Indirect word
CALL EARTH
Linkage information
for the procedure
of AIR
Invalid address
CALL FIRE
AI R
CALL AIR
Name of the
procedure is
stored as a
character
string
Invalid address
FI RE
CALL WATER
Invalid address
CALL EARTH
AATER
CALL WATER
(a)
A procedure segment
The linkage segment
Address of earth
EARTH
CALL EARTH
To earth
Invalid address
CALL FIRE
AI R
CALL AIR
Invalid address
FI RE
CALL WATER
Invalid address
CALL EARTH
WATER
CALL WATER
(b)
Figure 7-17. Dynamic linking. (a) Before EARTH is called. (b) After EARTH
has been called and linked.
When a procedure in a different segment is called, the attempt to address the
invalid word indirectly causes a trap to the dynamic linker. The linker then finds
the character string in the word following the invalid address and searches the
user's file directory for a compiled procedure with this name. That procedure is
then assigned a virtual address, usually in its own private segment, and this virtual
address overwrites the invalid address in the linkage segment, as indicated in
Fig. 7-17(b). Next, the instruction causing the linkage fault is re-executed, allow-
ing the program to continue from the place it was before the trap.
 
Search WWH ::




Custom Search