Category Archives

2 Articles

Linkers, Loaders and Libraries

1.2.2 (f) – Linkers, Loaders and Libraries


Libraries are pieces of code which are already created and compiled and can be used in other programs.

They are useful because it means that code isn’t repeated, it saves the developers time and money, and they are usually very well tested.

Linkers and Loaders

Static linking – After code generation stage of compilation, a static linker is used to compile the object code with the libraries used to create machine code.

Dynamic linking – Dynamic linking is when the dependencies are loaded when the code is executed by loaders which are part of the operating system.

Stages of Compilation

1.2.2 (e) – Applications Generation – Stages of compilation

(1) Lexical Analysis

  1. All comments and white space is removed.
  2. Code is turned into tokens.
  3. Symbol table created.

(2) Syntactic Analysis

  1. Checks syntax.
  2. Syntax tree is created using the symbol tree.

(3) Code Generation

  1. Syntax tree is converted into object code.

(4) Code Optimisation

  1. Removes unneeded code to make sure it runs as fast as possible, such as unused functions or variables.