PART I SISTEM UTILITIES LECTURE 4.1 LINK_LOAD Ştefan Stăncescu 1.

Slides:



Advertisements
Similar presentations
1 Loaders and Linkers Chapter 3 System Software An introduction to systems programming Leland L. Beck.
Advertisements

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.
Loaders and Linkers CS 230 이준원. 2 Overview assembler –generates an object code in a predefined format »COFF (common object file format) »ELF (executable.
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Mr. D. J. Patel, AITS, Rajkot 1 Operating Systems, by Dhananjay Dhamdhere1 Static and Dynamic Memory Allocation Memory allocation is an aspect of a more.
The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
CS 31003: Compilers ANIRUDDHA GUPTA 11CS10004 G2 CLASS DATE : 24/07/2013.
1 Starting a Program The 4 stages that take a C++ program (or any high-level programming language) and execute it in internal memory are: Compiler - C++
Loaders and Linkers Object Program contains the information:
Memory Management Chapter 7.
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.
CS2422 Assembly Language & System Programming January 2, 2007.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 33: Code Generation and Linking COMP 144 Programming Language Concepts Spring 2002.
Loader- Machine Independent Loader Features
An introduction to systems programming
1 Chapter 3 Loaders and Linkers Source Program Assembler Object Code Loader Executable Code Linker.
Loader- Machine Dependent Loader Features
Operating System Concepts
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Memory management. Instruction execution cycle Fetch instruction from main memory Decode instruction Fetch operands (if needed0 Execute instruction Store.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
A genda for Today What is memory management Source code to execution Address binding Logical and physical address spaces Dynamic loading, dynamic linking,
First part System Utilities Lecture 3 ASSEMBLER Ştefan Stăncescu 1.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Chapter 1 Computer architecture Languages: machine, assembly, high
The LC-3 – Chapter 7 COMP 2620 Dr. James Money COMP
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /29/2013 Lecture 13: Compile-Link-Load Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
RNJ 05/05/091 6 Further System Fundamentals (HL) ‏ 6.3 Operating Systems and Utility Software Linkers, Loaders and Library Managers.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
2 : Assembler 1 Chapter II: Assembler Chapter goal: r Introduce the fundamental functions that any assembler must perform. m Assign machine address m Translate.
L ECTURE -9 Topics : Compiler Interpreter Loader Linker. Types of Software..
G.Umamaheswari Lect/IT R.M.D.EC system software
Loader and Linker.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 31 Memory Management.
LINKERS Execution of a program written in a language L involves the following steps: 1.Translation of the program: Performed by the translator for language.
Linking Loader untuk SIC/XE Machine. Lebih Lanjut mengenai Absolute Loader Shortcoming of an absolute loader –Programmer needs to specify the actual address.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
Hello world !!! ASCII representation of hello.c.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 – Loaders.
Loaders and Linkers T 李俊葦. 1. Loader Accepts the object programs , prepares these programs for execution by the computer , and indicates the execution.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Object Files & Linking. Object Sections Compiled code store as object files – Linux : ELF : Extensible Linking Format – Windows : PE : Portable Execution.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 –Linkers.
Lecture 3 Translation.
Machine dependent Assembler Features
Memory management.
Chapter 5- Assembling , Linking, and Executing Programs
System Programming and administration
Chapter 8 Main Memory.
and Executing Programs
Loaders and Linkers CSCI/CMPE 3334 David Egle.
Loaders and Linkers: Features
Machine Independent Features
Loaders and Linkers.
Memory Management Tasks
Computer Architecture
Loaders and Linkers.
Chapter 1 Computer architecture Languages: machine, assembly, high
An introduction to systems programming
Program Assembly.
Presentation transcript:

PART I SISTEM UTILITIES LECTURE 4.1 LINK_LOAD Ştefan Stăncescu 1

LINK-LOAD Absolute loader 2 Loading of an object file (asembled with a assembler, compiler, etc.) => object file prepare and transfer in machine memory Absolute loader when loading is direct, without preparing at address specified in the object file format specified address (Simple systems, embedded processors)

LINK-LOAD Absolute loader 3

LINK-LOAD Relocatability 4 Relocatability ability, for an object file loaded (with minimum modifications) at any address inmemory of being able to work well. 1.For linking more obj. file in a single compact obj. file 2.For dynamic memory management

LINK-LOAD Relocatable object file format Address modifier M separate section 5 NameNo. crt. byteField semantic Modifier1Field character „M” 2-3Modification size 4-35Relative location addresses in object file format “C” section, which are needed to be modified before link-load for relocatability

LINK-LOAD Relocatable object file format Relocation mask in section “C” 6 NameNo. crt. byteField semantic Content16Object field code, character „C” 17-18Current stripe starting address 19-20Current stripe length 21-36Code length / 8 = relocation mask length Assembled object code (128 bytes as example), Repeat n(=3 times as example) the zone

LINK-LOAD References 7 References symbolic names in link process, names transmitted between object files - modules defined in one single object module used in many (any other object modules). EXTERN references symbolic names defined in another object module than the object module in which they are used. PUBLIC references symbolic names defined in current object module but able to be used in another object modules

LINK-LOAD Relocatable object file format PUBLIC references 8 NameNo. crt. byteField semantic PUBLIC1PUBLIC field code, character „D”, 2-9PUBLIC symbolic name identifier 10-13Relative address PUBLIC symbol name, in the originating object code 14-73Repeat 2-13 positions, for any other PUBLIC name symbols (5 as example)

LINK-LOAD Relocatable object file format EXTERN references 9 NameNo. crt. byteField semantic EXTERN1EXTERN field code, character „E”, 2-9EXTERN symbolic name identifier 10-44Repeat 2-9 positions, for any other EXTERN name symbols (5 as example)

LINK-LOAD Linking 10 Link-editing or, shortly, linking, is the modify address process for a relocatable object file, in view to join another object files, with the aim to constitute a compact object file. The corresponding system utility is the link-editor (linker). Following a link, the obtained linked object file is relocatable and may be linked further to another object files

LINK-LOAD Linking 11 Address expression calculus in source files issue: for arithmetic expressions with relative addresses the calculus must gives an relative address result that must not depend of real address location of the linked object file, loaded in real memory at an address determined at the load time. Not all arithmetic expressions are equally permitted A correct expression must have only invariants at loading time, (no + or * or /, only -) as in, LUNGIME_ZONA EQU END_ZONA – START_ZONA

LINK-LOAD Static link 12 Static link generate a new relocatable object file, compact and remanent, to be loaded in any place in memory, established by the operating system before each run. Static link efficiency – when stable, repetitive general conditions and products in the process development at each run In such case, link time is only used at first run, others are for free.

LINK-LOAD Dynamic link 13 Dynamic link postpone link work until the last moment before each run, only needed object files are chosen and linked taking in account about program run state determined by current processing values obtained from current input data. The memory space is optimized, spares, not needed object files are not linked, nor loaded in the memory

LINK-LOAD Linker and loader 14

LINK-LOAD Link-loader 15

LINK-LOAD LINK EDITOR - EXEMPLE 16 LINK- EDITOR DATA STRUCTURES ESTAB - table with module names associated with address locations in the final object file, EXTERN and PUBLIC references names, for PUBLIC references, their addresses in the final linked module. PROGADR- address register for linked program module load address; CSADR - current module first code address register with the reference address for all relative addresses of the current object module in linking process. CSLTH - current module length register. EXECADR - execution address register with starting program address.

LINK-LOAD EDITOR DE LEGATURI - EXEMPLU - PAS I 17

LINK-LOAD EDITOR DE LEGATURI - EXEMPLU - PAS II 18