Revise Computingrevisecomputing.co.uk
Free student revisionSee questionsFor schoolsSchool enquiry
Free revisionSee questionsFor schoolsSchool enquiry
Knowledge/A Level/H446/01 Computer systems/Applications Generation/Linkers and loaders and use of libraries

Linkers and loaders and use of libraries

1.2.2 Applications Generation

Practise exam questions

Applications Generation — Note 6 of 6

Candidates need to understand what code libraries are, how they are used and the benefits and drawbacks from using libraries. Candidates should have experience of using libraries to write programs. Candidates should understand how libraries are used during compilation, and how linkers and loaders are used to combine the code and library code into the final executable file.

What you need to know

Programs rarely contain all their own code. They use libraries of pre-written code, which a linker combines with the compiled program, and a loader then places the finished program into memory ready to run.

What to know

  • Benefits of libraries: saves development time; code is already tested and reliable; written by specialists, often highly optimised; lets programmers use complex features without knowing how they work.

Key terms

Library

A collection of pre-written, pre-compiled and tested subroutines that can be used in other programs.

  • Drawbacks of libraries: may not do exactly what is needed; may include unneeded code making the program larger; relies on the library author for bug fixes and updates; possible compatibility or licensing issues.
  • Static linking: library code is copied into the executable. The program is larger but self-contained.
  • Dynamic linking: the executable only contains references; library code (e.g. a DLL) is loaded when the program runs. The program is smaller and benefits from library updates, but fails if the library is missing or an incompatible version is installed.
Linker

Combines the compiled object code of a program with the object code of the library routines it uses, producing a single executable file.

Loader

Part of the operating system that copies the executable from secondary storage into RAM, allocates memory, adjusts memory addresses and loads any dynamically linked libraries.

Exam technique

  • Tip:Make sure you can explain the difference between static and dynamic linking, with a benefit and drawback of each.

Ready to test yourself?

Practise 1.2.2 questions
← Previous noteStages of compilation: lexical analysis, syntax analysis, code generation and optimisation1.2.2 Applications GenerationNext topic →Waterfall lifecycle, agile methodologies, extreme programming, spiral model and RAD1.2.3 Software Development

Back to Applications Generation

Applications Generation

Note 6 of 6

  1. 1The nature of applications, justifying suitable applications for a specific purpose
  2. 2Utilities
  3. 3Open source vs closed source
  4. 4Translators: interpreters, compilers and assemblers
  5. 5Stages of compilation: lexical analysis, syntax analysis, code generation and optimisation
  6. 6Linkers and loaders and use of libraries
Topic overview