From OSDev Wiki
Jump to: navigation, search

This article is a stub! This page or section is a stub. You can help the wiki by accurately contributing to it.

GNU Linker


The GNU Linker (executable named 'ld') is part of the binutils package. It is the standard linker under Linux and other Unix-like operating systems. It supports most input and output formats in existence (through the use of libbfd), and it is reportedly the most flexible of the listed linkers.



  • Supports most known input formats (ELF, DJGPP/COFF, Win32/COFF, a.out, etc)
  • Supports most known output formats (ELF, Win32/PE, COFF, a.out etc).
  • Supports creation of shared libraries.
  • Provides full control over the generated output file, through the flexible Linker Script language.
  • Can create flat binary files.
  • Can specify code/data addresses, with separate load and execution addresses (vital for a higher half kernel).
  • Supports DWARF, ECOFF and STABS debugging information.
  • Free software under the GPL version 3.


ld does not create shared libraries by itself. You have to give the proper flags to the compiler so that it can generate position-independent code (note that this is talking about ELF shared libraries only).

ld is able to link while keeping relocations in your final object (called the 'incremental link'), and it also can leave unresolved symbols if instructed to do so.

You might also want to check out ar, a static-link library companion for ld.

See Also


External Links

Personal tools