ld.gold
multi-threaded ELF linker from GNU binutils
TLDR
SYNOPSIS
ld.gold [options] files...
DESCRIPTION
ld.gold (commonly invoked as gold) is a high-performance ELF-only linker written for GNU binutils. Compared to the traditional GNU ld it is significantly faster on large C++ codebases, thanks to parallel processing of input objects, locality-aware symbol resolution, and an internal design tuned for modern multi-core CPUs.Most projects invoke gold indirectly through the compiler driver with -fuse-ld=gold. It accepts the GNU ld command line for the most common options, which makes drop-in adoption straightforward. Specialized features like --incremental linking, plugin support (LTO), and DWARF-aware output are exposed through gold-specific options.
PARAMETERS
FILES
Object files (.o) and archives (.a) to link.-o FILE
Write the linked output to FILE.-l NAME
Search for libNAME.so or libNAME.a in the link path.-L DIR
Add DIR to the library search path.-shared
Produce a shared object instead of an executable.-static
Produce a fully statically linked executable.--threads, --no-threads
Enable or disable multi-threaded link stages.--thread-count N
Use N worker threads when --threads is on.--incremental
Re-use a previous link's output for unchanged inputs.--gc-sections
Discard unreferenced sections from the output.-r, --relocatable
Produce a relocatable object (partial link).--help
Display help information.
CAVEATS
ELF only: gold cannot produce PE/COFF (Windows) or Mach-O (macOS) outputs. It supports a subset of GNU ld's linker scripts; very intricate scripts may need adjustment. Modern projects often use LLVM lld (faster still and cross-platform) instead; gold's upstream development has been deprioritized within binutils.
HISTORY
Gold was developed at Google by Ian Lance Taylor to speed up large C++ links and was contributed to GNU binutils in 2008. It was the default ELF linker on many distributions throughout the 2010s before LLVM's lld matured. In 2022 the binutils maintainers placed gold into maintenance mode, recommending lld or new ld features for new work.