Home » Linux Command Reference » UNIX/LINUX Command – ld

UNIX/LINUX Command – ld

Last updated May 10, 2021


ld—The GNU linker


ld [ –o.I output ] .I objfile . . . .br .RB [“–A output ] objfile … [–A architecture ][–b\ input-format ][–Bstatic ][–c\ commandfile ][ –d|–dc|–dp ][ –defsym\ symbol = expression ][–e\ entry ][–F ][–F\ format ][–format\ input-format ][–g ][–G size ][–help ][–i ][–l ar ][–L searchdir ][–M][–Map mapfile ][–m emulation ][–n|–N][–noinhibit-exec ][–oformat\ output-format ][–R\ filename ][–relax ][ –r|–Ur][–S ][–s ][–sort–common][–T\ commandfile ][–Ttext\textorg ][–Tdata\ dataorg ][–Tbss\ bssorg ][–t ][–u\ sym ][–V ][–v][–verbose ][–version ][–warn–common][–warn–once][–X ] [ –x ]


ld combines a number of object and archive files, relocates their data, and ties up symbol references. Often the last step in building a new compiled program to run is a call to ld.

ld accepts Linker Command Language files to provide explicit and total control over the linking process. This man page does not describe the command language; see the ld entry in info, or the manual Ld: The GNU Linker, for full details on the command language and on other aspects of the GNU linker.

This version of ld uses the general-purpose BFD libraries to operate on object files. This allows ld to read, combine, and write object files in many different formats, for example, COFF or a.out. Different formats may be linked together to produce any available kind of object file. You can use objdump –i to get a list of formats supported on various architectures.

Aside from its flexibility, the GNU linker is more helpful than other linkers in providing diagnostic information. Many linkers abandon execution immediately upon encountering an error; whenever possible, ld continues executing, allowing you to identify other errors (or, in some cases, to get an output file in spite of the error).

The GNU linker ld is meant to cover a broad range of situations, and to be as compatible as possible with other linkers. As a result, you have many choices to control its behavior through the command line, and through environment variables.

Related Posts

UNIX/LINUX Command – rsync

UNIX/LINUX Command – rsync

NAME rsync – a fast, versatile, remote (and local) file-copying tool rsync Command SYNOPSIS Local: rsync [OPTION…] SRC… [DEST] Access via remote shell:Pull: rsync [OPTION…] [USER@]HOST:SRC… [DEST]Push: rsync [OPTION…] SRC… [USER@]HOST:DEST Access via rsync...

UNIX/LINUX Command – strip

UNIX/LINUX Command – strip

NAME strip—Discard symbols from object files. SYNOPSIS strip [ -Fbfdname|–target=bfdname ] [ -Ibfdname|–input-target=bfdname ] [ -Obfdname|–output-target=bfdname ] [-Rsectionname|–remove-section=sectionname ] [ -s|–strip-all ] [-S|-g|–strip-debug ][-x|–discard-all...

UNIX/LINUX Command – expand

UNIX/LINUX Command – expand

NAME expand—Convert tabs to spaces SYNOPSIS expand [–tab1[,tab2[,…]]] [–t tab1[,tab2[,…]]] [–i] [—tabs=tab1[,tab2[,…]]] [–initial] [–help] [–version] [file…] DESCRIPTION This manual page documents the GNU version of expand. expand writes the contents of each given...

UNIX/LINUX Command – uuencode

UNIX/LINUX Command – uuencode

NAME uuencode—Encode a binary fileuudecode—Decode a file created by uuencode SYNOPSIS uuencode [-m] [ file ] nameuudecode [-o outfile] [ file ]… DESCRIPTION uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other...

Follow Us

Our Communities

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!



Submit a Comment

Your email address will not be published. Required fields are marked *

11 − four =