Machine-Independent Loader Features

Slides:



Advertisements
Similar presentations
The Assembly Language Level
Advertisements

1 Loaders and Linkers Chapter 3 System Software An introduction to systems programming Leland L. Beck.
Chapter 3 Loaders and Linkers
Linkage Editors Difference between a linkage editor and a linking loader: Linking loader performs all linking and relocation operations, including automatic.
3. Loaders & Linkers1 Chapter III: Loaders and Linkers Chapter goal: r To realize how a source program be loaded into memory m Loading m Relocation m Linking.
Chapter 3 Loaders and Linkers
COP 3402 Systems Programming Dr. Ali Orooji School of EECS University of Central Florida.
Chapter 3 Loaders and Linkers. Purpose and Function Places object program in memory Linking – Combines 2 or more obj programs Relocation – Allows loading.
Macro Processor.
Loader. Role of Loader Source Program Translator Object Program Loader Object program ready for execution Memory Translator – Assembler/Compiler.
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Machine Independent Assembler Features
Loaders and Linkers Object Program contains the information:
Chap 3 Loaders and Linkers. Object program contains translated instructions and data values from the source program. Loading, which brings the object.
1 Machine-Independent Features Automatic Library Search automatically incorporate routines from a subprogram library Loading Options.
CS2422 Assembly Language and System Programming Linking Loader Department of Computer Science National Tsing Hua University.
Chih-Hung Wang Chapter 2: Assembler (Part-1) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley, 1997.
CS2422 Assembly Language & System Programming January 2, 2007.
Assembler – Assembler Design Options. One-Pass Assemblers (1/2) Main problem  Forward references Data items Labels on instructions Solution  Data items:
Loader- Machine Independent Loader Features
CS2422 Assembly Language & System Programming December 22, 2005.
An introduction to systems programming
1 Chapter 3 Loaders and Linkers Source Program Assembler Object Code Loader Executable Code Linker.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Loader- Machine Dependent Loader Features
A Guide to SQL, Seventh Edition. Objectives Embed SQL commands in PL/SQL programs Retrieve single rows using embedded SQL Update a table using embedded.
Assembler – Machine Independent Features. Literals Design idea  Let programmers to be able to write the value of a constant operand as a part of the.
CS2422 Assembly Language & System Programming December 14, 2006.
ALGORITHMS AND FLOWCHARTS
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
A Simple Two-Pass Assembler
The LC-3 – Chapter 7 COMP 2620 Dr. James Money COMP
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
CS2422 Assembly Language and System Programming Assembler Design Options Department of Computer Science National Tsing Hua University.
Machine-Independent Assembler Features Literals, Symbol-Defining Statements, Expressions, Program Blocks, Control Sections and Program Linking.
2 : Assembler 1 Chapter II: Assembler Chapter goal: r Introduce the fundamental functions that any assembler must perform. m Assign machine address m Translate.
Chapter - 3 Loaders & Linkers. Overview of Chapter 3 Basic Loader Functions Design Issues of: An Absolute Loader Simple Bootstrap Loader Machine-Dependent.
Loader and Linker.
Assembler Design Options One-Pass and Multi-Pass Assemblers.
Macro Processors Basic Functions Machine-Independent Features Design Options Implementation Examples.
Linking Loader untuk SIC/XE Machine. Lebih Lanjut mengenai Absolute Loader Shortcoming of an absolute loader –Programmer needs to specify the actual address.
UNIT III LOADERS AND LINKERS. This Unit gives you… Basic Loader Functions Machine-Dependent Loader Features Machine-Independent Loader Feature Loader.
Hello world !!! ASCII representation of hello.c.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 –Linkers.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 9 - Assembler 4.
A Guide to SQL, Seventh Edition
Computer Science 210 Computer Organization
CHP - 9 File Structures.
System Programming and administration
Linking & Loading.
Assembler Design Options
Computer Science 210 Computer Organization
ALGORITHMS AND FLOWCHARTS
Loaders and Linkers CSCI/CMPE 3334 David Egle.
Loaders and Linkers: Features
Machine Independent Features
Loaders and Linkers.
Memory Management Tasks
ALGORITHMS AND FLOWCHARTS
A Simple Two-Pass Assembler
System Programming by Leland L. Beck Chapter 2
Data Groupings: File File: a group of related records
Machine Independent Assembler Features
Machine Independent Assembler Features
An introduction to systems programming
UNIT III LOADERS AND LINKERS
Chapter 3 Loaders and Linkers
Presentation transcript:

Machine-Independent Loader Features Automatic Library Search Loader Options

Machine-Independent Loader Features Automatic library search for handling external references allows a programmer to use standard subroutines which are automatically retrieved from a library as they are needed during linking Options of linking and loading Specifying alternative sources of input Changing or deleting external references Controlling the automatic processing of external references

Automatic Library Search Goal: automatically incorporate routines from subprogram libraries into the program being loaded Standard system library Libraries specified by control statements or by parameters to the loader The subroutines called by the program are automatically fetched from the library, linked with the main program, and loaded. The programmer does not need to take any action beyond mentioning the subroutine names as external references in the source program

Implementation of Automatic Library Search Linking loader must keep track of external symbols that are referred to, but not defined, in the primary input to the loader. Enter symbols from each Refer record into ESTAB and mark them undefined unless these symbols are already present Make the symbol defined when its definition is encountered At the end of Pass1, the symbols in ESTAB that remain undefined represent unresolved external references. The loader searches the libraries for routines that contain the definitions of these unresolved symbols, and processes the subroutines found by this search process exactly as if they had been part of the primary input stream. Repeat the above library search process until all references are resolved, because the fetched subroutines may themselves contain external references.

Discussions of Automatic Library Search The presented linking loader allows the programmer to override the standard subroutines by supplying his/her own routines. Directory The loader searches for the subroutines by scanning the Define records for all of the object programs. It can be more efficient by searching a directory giving the name and address of each routine. The same techniques applies equally well to the resolution of external references to data items.

Loader Options Users can specify options that modify the standard processing of the loader. How to specify options (usually using a special command language): Separate input file Statements embedded in the primary input stream between object programs Loader control statements included in the source program

Loader Options Typical loader options: Selection of alternative sources of input INCLUDE program-name(library-name) Direct the loader to read the designated object program from a library Deletion of external symbols DELETE csect-name Instruct the loader to delete the named control sections from the set of programs being loaded Change the external symbols CHANGE name1, name2 Cause the external symbol name1 to be changed to name2 wherever it appears in the program Automatic inclusion of library routines LIBRARY MYLIB Specify alternative libraries to be searched User-specified libraries are normally searched before the standard system libraries. NOCALL name Specify the external reference name are to remain unresolved.

Example of Using Loader Options In the COPY program, two subroutines, RDREC and WRREC, are used to read/write records. Suppose that the utility subroutines contain READ and WRITE that perform the same functions of RDREC and WRREC. Without reassembling the program, a sequence of loader commands could be used to use READ and WRITE instead of RDREC and WRREC: INCLUDE READ(UTLIB) INCLUDE WRITE(UTLIB) DELETE RDREC, WRREC CHANGE RDREC, READ CHANGE WRREC, WRITE