LD
LD is the GNU Linker, sometimes also referred to as gld or ld.bfd. It is designed to combine object files and libraries into executables and shared libraries. It is part of the GNU Binutils project.
LD is often invoked directly by the GCC compiler, so many users are unaware of its existence.
LD is not necessarily the fastest linker (eg: 1, 2), but is certainly seeing occasional performance improvement work. Its primary goals include supporting a diverse set of architectures and file formats, and to provide a lot of features. If linking speed is more important, then another linker, such as gold, lld, or mold should be considered.
LD is a static linker which means that it runs when a application or shared library is being built. It is not the same as a dynamic linker which runs when an application starts. LD creates binary files which can be run, a dynamic linker (often called ld.so) takes these run-able files and actually starts them executing.
LD is controlled via its command line and special script files. The script files tell the linker how to lay out an application in memory and the command line tells the linker which files to combine and what non-default things it should do.
Here is a simple example of an LD command line:
ld foo.o bar.o -lfred -o prog
This combines two input object files foo.o and bar.o with the fred library and creates an output file called prog. No linker script has been specified, so LD will uses its own, built-in internal script.
The linker has lots of options that can be used to control its behaviour, although in general the defaults should work for most situations. One option that might be of interest however is the ability to specify the order in which sections are placed into the output file. This can have a significant effect on the performance of the linked binary. This feature is used by profile based enhancer tools like sediment, Intel's thin layout optimizer and NVDIA's code locality tool.