levo

Applications Generation

Linkers, loaders and libraries

  • 1 thing to know
  • Component 01

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.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

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

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

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

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

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

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

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.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

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