How Program linking is possible in loaders?


The Goal of program linking is to resolve the problems with external references (EXTREF) and external definitions (EXTDEF) from different control sections.
EXTDEF (external definition) - The EXTDEF statement in a control section names symbols, called external symbols, that are defined in this (present) control section and may be used by other sections.

ex: EXTDEF BUFFER, BUFFEND, LENGTH EXTDEF LISTA, ENDA EXTREF (external reference) - The EXTREF statement names symbols used in this (present) control section and are defined elsewhere. ex: EXTREF RDREC, WRREC EXTREF LISTB, ENDB, LISTC, ENDC

How to implement EXTDEF and EXTREF
The assembler must include information in the object program that will cause the loader to insert proper values where they are required – in the form of Define record (D) and, Refer record(R).
Define record
The format of the Define record (D) along with examples is as shown here. Col. 1 D Col. 2-7 Name of external symbol defined in this control section Col. 8-13 Relative address within this control section (hexadecimal) Col.14-73 Repeat information in Col. 2-13 for other external symbols


Share to whatsapp

More Questions from System Software and Compiler Design Module 2

Structure of a Compiler Design - Phases of Compiler
View
Difference Between Linking Loader vs Linkage Editor
View
With an algorithm, explain pass1 of a linking loader
View
Lexical Analyzer Architecture.
(or) How tokens are recognized
View
Write note on MASM assembler
View
Explain the absolute loader and Write its algorithm.
View
How object program can be processed using linkage editor?
View