1 / 18

PART I SISTEM UTILITIES

Ştefan Stăncescu. PART I SISTEM UTILITIES. LECTURE 4.1 LINK_LOAD. LINK-LOAD Absolute loader. L oading 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

Download Presentation

PART I SISTEM UTILITIES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. LINK-LOADAbsolute loader • 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)

  3. LINK-LOAD Absolute loader

  4. LINK-LOADRelocatability • Relocatability ability, for an objectfile loaded (with minimum modifications) at any address in memory • ofbeing able to work well. • For linking • more obj. file in a single compact obj. file • 2. For dynamic memory management

  5. LINK-LOADRelocatable object file formatAddress modifier M separate section

  6. LINK-LOADRelocatable object file formatRelocation mask in section “C”

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

  8. LINK-LOADRelocatable object file formatPUBLIC references

  9. LINK-LOAD Relocatable object file format EXTERN references

  10. LINK-LOADLinking • Link-editingor, 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

  11. LINK-LOAD Linking • 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 expressionmust have only invariants at loading time, (no + or * or /, only -) as in, • LUNGIME_ZONA EQU END_ZONA – START_ZONA

  12. LINK-LOADStatic link • 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.

  13. LINK-LOADDynamic link • 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

  14. LINK-LOADLinker and loader

  15. LINK-LOADLink-loader

  16. LINK-LOADLINK EDITOR - EXEMPLE • LINK- EDITOR DATA STRUCTURES • ESTAB - tablewith • module names associated with address locations in the final object file, • EXTERN and PUBLIC references names, • for PUBLIC references, their addressesin the final linked module. • PROGADR - address register for linked program module load address; • CSADR- current module first code address registerwith • 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.

  17. LINK-LOADEDITOR DE LEGATURI - EXEMPLU - PAS I

  18. LINK-LOADEDITOR DE LEGATURI - EXEMPLU - PAS II

More Related