LLMpediaThe first transparent, open encyclopedia generated by LLMs

lld (linker)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: cargo (software) Hop 4
Expansion Funnel Raw 62 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted62
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
lld (linker)
Namelld
Titlelld
DeveloperGoogle/LLVM Project
Released2014
Programming languageC++
Operating systemLinux, Windows, macOS
GenreLinker
LicenseNCSA/University of Illinois Open Source License

lld (linker).

lld is a high-performance, open-source linker implementation originating within the LLVM Project and developed with contributions from multiple organizations such as Google, Apple Inc., Intel, and ARM Holdings. It provides drop-in linking capabilities for toolchains that historically used linkers like GNU Binutils's ld, link.exe, and gold, aiming to offer faster link times, modern format support, and tighter integration with LLVM components such as Clang and LLVM IR. lld is used across diverse projects and products, from open-source systems to commercial operating system components and embedded toolchains.

Overview

lld is implemented as part of the LLVM Project ecosystem to replace or complement traditional linkers such as ld and link.exe in build toolchains for projects including Chromium, Android, FreeBSD, and various Linux distributions. It supports multiple binary formats adopted by platforms and vendors like ELF, Mach-O, and PE/COFF, serving compiler front ends like Clang and toolchains built by GCC-based projects. lld's goals include improving linking throughput for large codebases, reducing memory usage compared to legacy linkers such as gold and GNU Binutils, and enabling link-time features leveraged by technologies such as Link Time Optimization and LTO integrations.

Design and Architecture

lld's architecture is modular and format-oriented, with distinct backends for linkable formats including ELF, Mach-O, and PE/COFF. The core design emphasizes single-pass and multi-threaded algorithms inspired by work from projects like gold and design patterns documented by Unix linker researchers. lld interfaces with object file parsers and metadata producers such as LLVM IR and object readers from LLVM Object, while coordinating symbol resolution, relocation processing, and section layout. Its memory management and data structures draw on C++ techniques used in projects like Chromium and Mozilla Firefox to balance speed against peak memory use, enabling deployment in resource-constrained environments such as Android build servers and embedded platforms supported by ARM Holdings.

Supported Platforms and Formats

lld implements backends for primary executable formats and corresponding platform ABIs, including ELF for Linux, various ARM and x86 ABIs for embedded and mobile targets, Mach-O for macOS and iOS, and PE/COFF for Microsoft Windows. It supports linking for architectures such as x86-64, ARMv7, AArch64, MIPS, and experimental support for targets used by projects like FreeBSD and NetBSD. The tool integrates with platform-specific conventions used by vendors like Apple Inc. and Microsoft, and supports features such as prelinked images used by Android and kernel module linking in projects like Linux kernel-based distributions. lld also handles containerized and cross-compilation scenarios common to ecosystems like Docker-based CI for Chromium and Kubernetes clusters.

Features and Performance

lld emphasizes fast incremental and full linking, parallel symbol resolution, and optimized relocation application. Performance comparisons in large builds often cite improvements versus GNU Binutils and gold in projects such as Chromium, LLVM Project itself, and Android, with latency and throughput benefits on continuous integration systems like those used by Google and Mozilla. Feature-wise, lld supports link-time optimizations used with LTO and ThinLTO, incremental linking workflows akin to link.exe behavior, and diagnostics designed to integrate with IDEs from vendors such as Microsoft, JetBrains, and Apple Inc.. It exposes options for symbol versioning compatible with conventions from GNU libc and supports advanced relocation processing required by runtime linker implementations like ld.so and dyld.

Integration and Tooling

lld is distributed with LLVM releases and packaged in ecosystems such as Debian, Fedora, Homebrew, and vcpkg, enabling straightforward replacement of traditional linkers in build systems like CMake, Bazel, Ninja, and GNU Make. Integration points include driver wrappers used by Clang and compatibility modes that mimic command-line interfaces of ld and link.exe to ease adoption in projects like Chromium and Android. Tooling around lld includes diagnostics parsers used in continuous integration systems at organizations like Google and Apple Inc., and support libraries that interoperate with debuggers such as GDB and LLDB for symbol resolution and stack unwinding.

Development History and Governance

lld began as an LLVM subproject with initial contributions from engineers at Google and Apple Inc. and continued evolution steered by contributors from companies including Intel and ARM Holdings. Governance follows the LLVM Project model with maintainers, committers, and community review on platforms like Phabricator (historically) and GitHub or GitLab mirrors used by various stakeholders. Major milestones include initial support for ELF linking, later additions of Mach-O and PE/COFF backends, and progressive work to support LTO and ThinLTO workflows adopted by projects such as Chromium and Android. Development is coordinated through community meetings and code reviews that involve corporate contributors and individual maintainers from global organizations including Google, Apple Inc., Intel, and academic collaborators.

Category:LLVM