This document contains the release notes for the LLD linker, release 3.9. Here we describe the status of LLD, including major improvements from the previous release. All LLD releases may be downloaded from the LLVM releases web site.
LLD 3.9 is a major milestone for us. It is the first release that can link real-world large userland programs, including LLVM/Clang/LLD themselves. In fact, for example, it can now be used to produce most userland programs distributed as part of FreeBSD.
Many contributors have joined to the project to develop new features, port it to new architectures and fix issues since the last release.
Initial support for LTO has been added. It is compatible with the LLVM gold plugin in terms of command line flags and input file format so that LLD is usable as a drop-in replacement for GNU gold. LTO is implemented as a native feature unlike the GNU gold’s plugin mechanism.
LLD 3.9 can now merge identical code sections to produce smaller output files. It is expected to be used with -ffunction-sections.
LLD 3.9 is able to link against versioned symbols as well as produce versioned symbols. Both the original Sun’s symbol versioning scheme and the GNU extension are supported.
LLD has expanded support for new targets, including ARM/Thumb, the x32 ABI and MIPS N64 ABI, in addition to the existing support for x86, x86-64, MIPS, PowerPC and PPC64.
The ELF ABI specification of the thread-local variable define a few peephole optimizations linkers can do by rewriting instructions at the link-time to reduce run-time overhead to access TLS variables. That feature has been implemented.
Many command line options have been added in this release, including:
A new CMake variable, LLVM_ENABLE_LLD, has been added to use LLD to build the LLVM toolchain. If the varaible is true, -fuse-ld=lld option will be added to linker flags so that ld.lld is used instead of default ld. Because -fuse-ld=lld is a new compiler driver option, you need Clang 3.8 or newer to use the feature.