Translators
A linker is a program that joins pieces of object code together into a single executable file. You rarely write a large program as one giant file, so the linker is what turns the separately translated pieces into one program that the computer can load and run.
A linker is not a translator. Every file it receives has already been translated into object code by a compiler, and the linker never reads or converts source code. Linking happens after compilation and before the program is run, and it is the last thing that happens to the object code a compiler produces: object code cannot run until it has been linked.
Writing a big program as several smaller source code files keeps it organised and lets different programmers work on different parts at the same time. Take an app for booking lanes at a bowling alley, written as three source files: one for the lanes, one for payments and one for printing receipts. Each file is compiled on its own, producing three separate object code files. None of them can run alone, because each calls routines held in the others.
The linker joins all three object code files into one. It also adds any library routines the program uses, such as a ready-made routine for displaying text on the screen, so those routines do not have to be written from scratch. The result is one executable file.
The linker checks that everything the program refers to can actually be found. If an object code file is missing, or a routine is called but no file or library supplies it, the linker reports an error and no executable is produced, so the program cannot be run until the problem is fixed.
Edexcel GCSE Computer Science · Translators