The linker hld is responsible for linking together the object files which make up your application together with some run-time startup code and any support libraries.
Although the compiler driver usually invokes the linker for you, we fully describe how the linker can be used stand-alone. If you’re maintaining your project with a make-like program, you may wish to use this information to invoke the linker directly rather than using the compiler driver.
The linker performs the following functions:
- resolves references between object modules;
- extracts object modules from archives to resolve unsatisfied references;
- combines all fragments belonging to the same section into a contiguous region;
- removes all unreferenced code and data;
- runs an architecture-specific optimizer to improve the object code;
- fixes the size of span-dependent instructions;
- computes all relocatable values;
- produces a linked application and writes it in a number of formats.