lld 22.1.0 Release Notes¶
Introduction¶
This document contains the release notes for the lld linker, release 22.1.0. 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.
Non-comprehensive list of changes in this release¶
ELF Improvements¶
Added
--print-gc-sections=<file>to redirect garbage collection section listing to a file, avoiding contamination of stdout with other linker output. (#159706)Added
VersionNodelexer state for better version script parsing. This brings the lexer behavior closer to GNU ld. (#174530)Unversioned undefined symbols now use version index 0, aligning with GNU ld 2.46 behavior. (#168189)
.data.rel.ro.hotand.data.rel.ro.unlikelyare now recognized as RELRO sections, allowing profile-guided static data partitioning. (#148920)DTLTO now supports archive members and bitcode members of thin archives. (#157043)
For DTLTO,
--thinlto-remote-compiler-prepend-arg=<arg>has been added to prepend an argument to the remote compiler’s command line. (#162456)Balanced Partitioning (BP) section ordering now skips input sections with null data, and filters out section symbols. (#149265) (#151685)
For AArch64, fixed a crash when using
--fix-cortex-a53-843419with synthetic sections and improved handling when patched code is far from the short jump. (#170495)For AArch64, added support for the
R_AARCH64_FUNCINIT64dynamic relocation type for relocating word-sized data using the return value of a function. (#156564)For AArch64, added support for the
R_AARCH64_PATCHINSTrelocation type to support deactivation symbols. (#133534)For AArch64, added support for reading AArch64 Build Attributes and converting them into GNU Properties. (#147970)
For ARM, fixed incorrect veneer generation for wraparound branches at the high end of the 32-bit address space branching to the low end. (#165263)
For LoongArch,
-rnow synthesizesR_LARCH_ALIGNat input section start to preserve alignment information. (#153935)For LoongArch, added relocation types for LA32R/LA32S. (#172618) (#176312)
For RISC-V, added infrastructure for handling vendor-specific relocations. (#159987)
For RISC-V, added support for statically resolved vendor-specific relocations. (#169273)
For RISC-V,
-rnow synthesizesR_RISCV_ALIGNat input section start to preserve alignment information during two-stage linking. (#151639)
Breaking changes¶
COFF Improvements¶
Added
-prefetch-inputsto improve link times by asynchronously loading input files in RAM. This will dampen the effect of input file I/O latency on link times. However this flag can have an adverse effect when linking a large number of inputs files, or if all inputs do not fit in RAM at once. For those cases, linking might be a bit slower since the inputs will be streamed into RAM upfront, only to be evicted later by swapping. (#169224)Added
/sectionlayout:@<file>to specify custom output section ordering. (#152779)Added
/nodbgdirmergeto emit the debug directory section in.cvinfoinstead of merging it to.rdata. (#159235)Added
-fat-lto-objectsto support FatLTO. Without-fat-lto-objectsor with-fat-lto-objects:no, LLD will link LLVM FatLTO objects using the relocatable object file. (#165529)Added
/linkreprofullpathrspto print the full path to each object passed to the link line to a file. This is used in particular when linking Arm64X binaries. (#174971)Added CET flags:
/cetcompatstrict,/cetipvalidationrelaxed,/cetdynamicapisinproc, and/hotpatchcompatible. (#150761)Added support for ARM64X same-address thunks. (#151255)
Added more
--time-tracetags for ThinLTO linking. (#156471)/summarynow works when/debugisn’t provided. (#157476)/summarynow displays the size of all consumed inputs. (#157284)For DTLTO,
-thinlto-remote-compiler-prepend-arg:<arg>has been added to prepend an argument to the remote compiler’s command line. (#162456)Loop and SLP vectorize options are now passed to the LTO backend. (#173041)
Deduplicate common chunks when linking COFF files. (#162553)
Discard
.llvmbcand.llvmcmdsections. (#150897)Prevent emitting relocations for discarded weak wrapped symbols. (#156214)
MinGW Improvements¶
MachO Improvements¶
Added
--read-workers=<N>for multi-threaded preload of input files into memory, significantly reducing link times for large projects. (#147134)Added
--separate-cstring-literal-sectionsto emit cstring literals into sections defined by their section name. (#158720)Added
--tail-merge-stringsto enable tail merging of cstrings. (#161262)Added
--lto-emit-llvmcommand line option.Added
--slop-scaleflag for adjusting slop scale. (#164295)Added support for section branch relocations, including the 1-byte form. (#169062)
Enabled Linker Optimization Hints pass for arm64_32. (#148964)
Read cstring order for non-deduped sections. (#161879)
Allow independent override of weak symbols aliased via
.set. (#167825)Fixed segfault while processing malformed object file. (#167025)
Fixed infinite recursion when parsing corrupted export tries. (#152569)
Error out gracefully when offset is outside literal section. (#164660)
Process OSO prefix only textually in both input and output. (#152063)
WebAssembly Improvements¶
--stack-firstis now the default. Use--no-stack-firstfor the old behavior. (#166998)--import-memorycan now take a single name (imports from default module). (#160409)-rnow forces-Bstatic. (#108264)LTO now uses PIC reloc model with dynamic imports. (#165342)
Honor command line reloc model during LTO. (#164838)
Fixed visibility of
__stack_pointerglobal. (#161284)Fixed check for exporting mutable globals. (#160787)
Fixed check for implicitly exported mutable globals. (#160966)
Don’t export deps for unused stub symbols. (#173422)
Fixed SEGFAULT when importing wrapped symbol. (#169656)
Error on unexpected relocation types in
-pie/-shareddata sections. (#162117)
