GCSE · Computer Science · Eduqas · Spec C500QS

Linker

Picture a program in separate pieces, one calling a subroutine that sits in another piece. Each piece was translated alone. Can it run yet?

Computer Science · Structure

Three pieces, two loose ends, one program

Each box is a translated piece of object code. Dashed lines are references that are not connected yet. Tap a piece to see what the linker does with it.

call: not connected yetlibrary call: not connected yet

Tap any part of the diagram to see what it does.

Computer Science · Building a program

Where does the linker fit?

Put the stages of building a program in the order they happen.

1 · Happens first6 · Happens last
  1. Separate pieces of object code now exist

  2. Run the program

  3. Translate each part on its own

  4. One executable program exists

  5. Write the program as separate parts

  6. Link the pieces with the library code they use

Exam line: Translate first, link second, run last. The linker sits between the translated pieces and the program you can run.

Computer Science · Linker

?

Reason it through

Why does a program built from separate pieces need a linker?

Link 1 of 4

First link · your turn

A program is split into parts and each part is translated on its own. What do you get?

2
Locked — reveal the link above first
3
Locked — reveal the link above first
4
Locked — reveal the link above first

Computer Science · Translator or linker?

Whose job is it?

Each of these jobs belongs to one tool. Which one does it?

Still to sort

The translator (0)

Works on one part at a time.

Where the line is: Produces object code from one part.

The linker (0)

Works on the translated pieces.

Where the line is: Joins pieces or connects a reference between them.

8 of 8 still to sort.

Exam line: The translator makes the pieces. The linker joins them and connects the references.

Computer Science · Reuse

Link in library codevsWrite and translate it yourself

Two ways to get a subroutine your program needs.

Focus

What the programmer writes

Link in library code

Only the code that calls the subroutine

Write and translate it yourself

The subroutine as well as the code that calls it

The insight

This is the difference that makes reuse worthwhile: with library code, the writing has already been done.

What has to be translated

Link in library code

Nothing extra, because the library code is already translated

Write and translate it yourself

The new subroutine, which becomes another piece of object code

What the linker joins

Link in library code

Your pieces plus the translated library code

Write and translate it yourself

Your pieces plus your own newly translated subroutine

Computer Science · Exam practice

Write it, then mark it

Describe what a linker does and explain why it is needed. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

Exam line: Hit each point separately: what it joins, what it connects, what it outputs, and why it is needed.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

The tool that joins separately translated pieces of a program into one program you can run.

What you need to know

  • Big programs are often split into parts, such as modules or files, and each part is translated on its own.
  • So translation gives you several separate pieces of object code, not one complete program.
  • Have a goYour friend translates all three parts of their program and shouts "Done, I've got my finished program!" How many pieces of object code do they actually have, and is that one complete program?

    Three separate pieces of object code, not one complete program.

    Each part is translated on its own, so the translator leaves separate pieces rather than one finished program.

  • A piece can call a subroutine, or use data, that is defined in another piece.
  • That call or use is a reference, and after translation it is not yet connected.
  • Have a goPiece A contains a call to a subroutine defined in piece B, and both have just been translated. Is that call connected to its subroutine yet?

    No, it is not yet connected.

    A reference into another piece is still unconnected straight after translation, which is the gap the linker exists to close.

  • A linker is a software development tool, used after translation, that joins the pieces of object code into one program.
  • Programs usually use prewritten library code too, and the linker joins the translated library code in with your own.
  • The linker connects each reference to the correct location of the code or data in the joined program.
  • The linker's output is a single executable program file that can be run.
  • Have a goThree pieces of object code and some library code go into the linker. How many runnable programs come out the other side?

    One: a single executable program file.

    The linker joins everything together, so you do not get the separate pieces handed back.

  • Linking lets programmers reuse already translated code, such as library code, instead of writing and translating it again.

The big picture

A program is often translated in separate parts, which leaves separate pieces of object code with references that are not yet connected. The linker, used after translation, joins those pieces and the library code they use, connects the references, and outputs one executable program.

Key points

1A linker is used after translation and joins separately translated pieces of object code into one program that can be run.
2It joins the program's own translated code with the translated library code the program uses.
3It connects each reference between pieces to the correct location of the code or data it needs.
4Its output is a single executable program file.

Worked example

Problem

A quiz program is written in two parts: quiz_main and questions. quiz_main calls a subroutine called get_question, which is defined in questions. Each part has been translated on its own. Can the program be run yet? Work out what has to happen next.

⚠ Watch out

Thinking translation on its own produces the finished program, or that the linker is just another translator. The translator makes separate pieces of object code. The linker, used after translation, joins the pieces and connects their references, and its output is the single executable file.

🧠

Memory hook

Translate in pieces, link into one: the linker is the glue that connects every loose reference.

✓

Check yourself

Without looking back: what do you have straight after translation, what is still unconnected, and what does the linker output once it has done its job?

Flashcards

(11)
What is a linker?
A software development tool, used after translation, that joins separately translated pieces of object code into one program that can be run.
Why might a program end up as several pieces of object code?
It is often made of separate parts, such as modules or files, and each part is translated on its own.
What does the translator produce when each part is translated on its own?
A separate piece of object code for each part, not one complete program.
What is a reference between pieces?
Code in one piece calling a subroutine, or using data, that is defined in another piece.
Is a reference between pieces connected straight after translation?
No. The references are not yet connected until the pieces are linked.
What does the linker do to each reference?
It hooks each one up to the correct location of the code or data in the joined program.
How does library code end up in your program?
The linker joins the translated library code with your own translated code, so it becomes part of the final program.
What is the output of the linker?
A single executable program file that can be run.
Why can separately translated pieces not run as one program?
Their references are not yet connected, so they cannot run as one program on their own.
What does linking let programmers avoid?
Writing and translating code again: they can reuse already translated code, such as library code.
When is the linker used, compared with the translator?
After translation. The translator makes the pieces and the linker joins them.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.