{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

linker-loader-arch-comp

linker-loader-arch-comp - CSE 341 Linker Loader...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 341 Linker, Loader, & Architecture Comparison Relocatable Code circle6 What is relocatable code? circle6 Why is relocatable code important? Linker circle6 aka , Link Editor circle6 Patches together segments of precompiled & assembled code into an executable circle6 Steps handptright Place code & data modules symbolically in memory handptright Derive address for data & instruction labels handptright Patch internal & external references circle6 Typically same format as object file, but without unresolved references, relocation information, symbol table, or debugging information handptright Note: Partially linked files are possible with unresolved addresses arrowdwnrt1 Result is another object file arrowdwnrt1 Example checkbld Library routines Loader circle6 Loads executable into memory & starts execution circle6 Steps handptright Determine size of text & data segments arrowdwnrt1 Refers to object file header handptright Allocate memory for data & text handptright Copy instructions & data to memory handptright Push parameters to main program onto stack handptright Initialize registers handptright Initialize stack pointer to first free location handptright Jump to start routine arrowdwnrt1 Copies parameters to argument registers arrowdwnrt1 Calls main program arrowdwnrt1 Upon return from main program checkbld Terminates program with exit system call Unix System Object File circle6 Components handptright Object File Header arrowdwnrt1 Size & position of other pieces of object file handptright Text Segment arrowdwnrt1 Machine language code
Image of page 1

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

View Full Document Right Arrow Icon
handptright Data Segment arrowdwnrt1 Static Data checkbld Allocated throughout program arrowdwnrt1 Dynamic Data checkbld Allocated & deallocated as needed handptright Relocation Information arrowdwnrt1 Identifies instruction & data words dependent upon absolute addresses handptright Symbol Table arrowdwnrt1 Remaining undefined labels arrowdwnrt1 Example checkbld External references handptright Debugging Information arrowdwnrt1 Description of compilation details arrowdwnrt1 Allows debugger to associate machine language instructions with source files & make data structures readable Linked Libraries circle6 Static handptright Library routines hardcoded into program handptright Disadvantages arrowdwnrt1 Does not allow for use of new versions of the library arrowdwnrt1 Whole library is loaded checkbld Not just routines needed circle6 Dynamic handptright Linked when program is run handptright Whole library not loaded handptright Overhead associated with DLLs outweighed by advantages Java circle6 Advantage handptright Portability circle6 Disadvantage handptright Performance circle6 How it works handptright Source code compiled to bytecode arrowdwnrt1 Bytecode is similar to assembly language handptright Bytecode is interpreted at runtime by Java Virtual Machine ( JVM ) circle6 Reducing the Performance Hit handptright The use of Just In Time ( JIT ) compilers to compile commonly used methods to native machine language & store the code for future use.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern