Chapter 3 Loaders and Linkers - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Chapter 3 Loaders and Linkers

Description:

Moves each text record to proper location. Upon seeing END passes control to the pgm ... Use absolute addressing and fixed format. No modification records required ... – PowerPoint PPT presentation

Number of Views:175
Avg rating:3.0/5.0
Slides: 11
Provided by: unf
Learn more at: https://www.unf.edu
Category:

less

Transcript and Presenter's Notes

Title: Chapter 3 Loaders and Linkers


1
Chapter 3Loaders and Linkers
2
Purpose and Function
  • Places object program in memory
  • Linking
  • Combines 2 or more obj programs
  • Relocation
  • Allows loading at different locations
  • Linkage Editor
  • Provides linking without loading

3
Kinds of Loaders
  • Absolute
  • Single pass
  • Checks for correct header record
  • Checks for sufficient available memory
  • Moves each text record to proper location
  • Upon seeing END passes control to the pgm

4
Kinds of loaders (cont.)
  • bootstrap
  • A special absolute loader
  • ROM
  • Loads the OS

5
Kinds of loaders (cont.)
  • Relocating
  • Modifies appropriate addresses
  • Loads object program at a variety of locations
  • May perform loading during execution (repeatedly)
  • Allows for multiple programs (multiprocessing)
  • System libraries require relocation

6
Methods of Relocation
  • Modification records
  • Use absolute addressing and fixed format
  • No modification records required
  • Use same text records with flag (relocation bit)
  • Relocation bits gathered into a mask
  • If relocation bit is 1, add starting address to
    word

7
Mask Method of Relocation
  • HCOPY 000000001077A
  • T0000001EFFC1400334810390000362800303000154810613C
    000300002A0C003900002D


  • FFC 111111111100 all 10 words need
    modification
  • T 00001E 15 E00 0C0036 481061 080033 4C0000
    454F46 000003 000000


  • E00 111000000000 instructions 0,1,2 need load
    addresses
  • T0000391EFFC0400300000030E0105D30103FD8105D2800303
    010575480392C105E38103F


  • T0010570A8001000364C0000F1001000
  • The F1 fouls up alignment, thus a new text record
    has to be started.

  • FIGURE 3.7

8
Program Linking
  • Necessary for separate CSECTS
  • External References
  • External Definitions

9
LOADING
  • Forward references to external symbols common
  • Use 2 pass
  • Pass 1 assigns addr. to external symbols
  • Provides a load map (info in symbol table)
  • Pass 2 performs actual loading, relocation, and
    linking

10
Data Structures for Loading
  • ESTAB external symbol table Stores
  • Names
  • Addresses
  • CSECT of external symbols
  • PROGADDR program load address
  • Provided by the OS
  • CSADDR CSECT addr. of control sect. loaded
Write a Comment
User Comments (0)
About PowerShow.com