Linking and Relocation
Definition
Diagram
Each of the source files is assembled individually, to create an object (*.o
) file. Since the object files use labels which are not yet defined, we replace them with a 0 and keep the label name as metadata (blue). The linker combines these object files and uses their metadata to output the correct memory offsets (relocation).