PAPER 1 • SOFTWARE AND SOFTWARE DEVELOPMENT • APPLICATIONS GENERATION

Linkers, Loaders and Libraries

  • When a programmer builds software, they often rely on pre-written library routines instead of writing every feature from scratch.
  • After compilation, a linker combines object code and any required library code into an executable file.
  • The loader then places that program into memory so it can run.

Visual channel

Source code modules
Compiler creates object files
Linker adds library code
Executable file
Loader places program in memory

Verbal channel

  • A library is pre-written, pre-tested code that a programmer can reuse.
  • The linker joins separately compiled modules and any required library routines.
  • Static linking copies code into the executable; dynamic linking uses shared libraries on the host computer.
  • The loader is part of the operating system that loads the executable into memory ready to run.

Activity 1

Linker Loadder concept map

Drag the labels and images onto the canvas, arrange them into a sensible linker-loader diagram, then click placed items to connect them.

Drag to position Click nodes to connect Build the translation route

Image wall

Activity 2

Benefits and drawbacks of library routines

These statements come from the teaching slides. Sort each one into the correct side of the debate.

Use libraries because...

Benefits

Watch out because...

Drawbacks

Activity 3

Static vs dynamic linking clinic

Choose whether each statement is describing static linking, dynamic linking, or both.

Code snippet taken from the answer materials
Compiled code and library calls eventually need linking and loading.