2.2.7

Linkers, Loaders & Libraries

Test yourself

Linkers, Loaders & Libraries

When programming, we often use libraries built into programming languages to make coding solutions quicker and easier. These are linked in, by linkers, and loaded by loaders when your code runs.

Illustrative background for LibrariesIllustrative background for Libraries ?? "content

Libraries

  • Libraries exist in most programming languages and offer shorthand ways to achieve a task.
  • These libraries are pre-written, compiled, tested and checked pieces of code that developers can rely on to help shorten code.
  • Libraries give developers shortcuts to achieve what they want without keep repeating code.
    • For example, the print function in python.
Illustrative background for LinkersIllustrative background for Linkers ?? "content

Linkers

  • Linkers are the software responsible for linking libraries to code that uses them.
    • Libraries can be statically linked or dynamically linked.
  • Statically linked libraries are included in the object or machine code when it is compiled.
  • This increases the binary footprint of the code, but the library becomes built into the code meaning an end user doesn’t need it to be installed.
Illustrative background for Dynamically linked librariesIllustrative background for Dynamically linked libraries ?? "content

Dynamically linked libraries

  • Dynamically linked libraries are not built into the code.
  • These libraries are loaded in when the object or machine code is passed to the CPU to run, just when it needs it.
  • Dynamically linked libraries mean your binary footprint is smaller, but the library needs to be installed on the computer.
Illustrative background for LoadersIllustrative background for Loaders ?? "content

Loaders

  • Loaders are a type of program that loads the program you're trying to run.
  • Loaders are a part of the operating system that find a good place for object or machine code to sit in memory.
  • For statically linked libraries all of the code and the library are loaded into memory, which takes up more room.
  • For dynamically linked libraries, the loader will load the library into memory when the program needs it.

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Procedurally

6.3Thinking Logically

7Problem Solving & Programming

8Algorithms

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson