levo

Applications Generation

Linkers, loaders and libraries

  • 1 thing to know
  • Component 01
Start revising · £5/month

Overview

Recall questions on linkers and loaders and the difference between them, libraries and their advantages and disadvantages, static and dynamic linking compared, and patching a vulnerable library under each kind of linking.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is a library, in the context of program development?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a linker?

    Model answer

    A program that combines the separate object files produced by compiling the parts of a program, together with any library code they use, into a single executable file. It resolves the references between them, so that a call in one module to a subroutine defined in another is given the correct address.

  2. 2

    Why is a linker needed at all?

    Model answer

    Large programs are written and compiled as separate modules, and they also use code from libraries that was compiled long before. Each module is compiled without knowing where the others will sit in memory, so its references to their subroutines and variables are left unresolved. The linker brings all the pieces together, fixes the addresses so every reference points at the right place, and produces one file that can actually be run.

  3. 3

    What is a loader?

    Model answer

    A part of the operating system that copies an executable program from secondary storage into main memory, places its code and data at the addresses it will use, sets up the program counter and stack, and starts execution. Where dynamic linking is used, the loader is also responsible for finding and bringing in the required library files.

  4. 4

    State the difference between a linker and a loader.

    Model answer

    The linker runs before the program is ever executed, combining object files and libraries into one executable and resolving the references between them. The loader runs each time the program is started, bringing that executable from storage into RAM and transferring control to it. The linker builds the program; the loader launches it.

  5. 5

    What is a library, in the context of program development?

    Model answer

    A collection of pre-written, pre-compiled and tested subroutines, classes or functions for common tasks - mathematical operations, sorting, graphics, encryption, file and network access - that a programmer can call from their own code rather than writing the same thing again.

  6. 6

    Give three advantages of using libraries.

    Model answer

    Development is much faster, because standard tasks do not have to be written from scratch. The code is already thoroughly tested and debugged by many users, so it is likely to be more reliable than a fresh implementation. It is often written by specialists and highly optimised, and in areas such as cryptography an amateur implementation would be dangerously weak. Libraries are also maintained separately, so improvements and security fixes can be picked up without rewriting your own program.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Applications Generation, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.