linker-loader-arch-comp

Linker-loader-arch-c - CSE 341 Linker Loader Architecture Comparison Relocatable Code What is relocatable code Why is relocatable code important

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 341 Relocatable Code c What is relocatable code? c Why is relocatable code important? Linker c aka , Link Editor c c Steps h h h c Typically same format as object file, but without unresolved references, relocation information, symbol table, or debugging information h Note: Partially linked files are possible with unresolved addresses a Result is another object file a Example C Library routines Loader c c Steps h a Refers to object file header h h h Push parameters to main program onto stack h Initialize registers h Initialize stack pointer to first free location h Jump to start routine a Copies parameters to argument registers a Calls main program a Upon return from main program C Terminates program with exit system call Unix System Object File c Components h Object File Header a h Text Segment a Machine language code
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
h Data Segment a Static Data c Allocated throughout program a Dynamic Data c h Relocation Information a h Symbol Table a Remaining undefined labels a Example c External references h Debugging Information a Description of compilation details a data structures readable Linked Libraries C Static h Library routines hardcoded into program h Disadvantages a Does not allow for use of new versions of the library a Whole library is loaded c Not just routines needed C Dynamic h Linked when program is run h Whole library not loaded h Overhead associated with DLLs outweighed by advantages Java C Advantage h Portability C Disadvantage h Performance C How it works h Source code compiled to bytecode a Bytecode is similar to assembly language h Bytecode is interpreted at runtime by Java Virtual Machine ( JVM ) C Reducing the Performance Hit h The use of Just In Time ( JIT ) compilers to compile commonly used methods to native h Speedup seen on subsequent runs
Background image of page 2
Compiler Optimizations c High-level Transformations h Procedure Inlining h Loop Transformations a Such as loop unrolling c h Local Optimizations a Optimize single blocks a Cleans up code before and after global optimization h Global Optimizations a Optimizing across multiple blocks a Global Register Allocation C Variable to register allocation c Optimizations Performed Locally and Globally h Common subexpression elimination a Such as reusing calculations h Strength Reduction a Replacing complex operations with simpler ones
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/03/2011 for the course CSE 341 at SUNY Buffalo.

Page1 / 14

Linker-loader-arch-c - CSE 341 Linker Loader Architecture Comparison Relocatable Code What is relocatable code Why is relocatable code important

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online