lld 22 ELF changes
For those unfamiliar, lld is theLLVM linker, supporting PE/COFF, ELF, Mach-O, and WebAssembly ports.These object file formats differ significantly, and each port mustfollow the conventions of the platform's system linker. As a result, theports share limited code (diagnostics, memory allocation, etc) and havelargely separate reviewer groups.
With LLVM 22.1 releasing soon, I've added some notes to the
For the first time, I used an LLM agent (Claude Code) to help lookthrough commits(git log release/21.x..release/22.x -- lld/ELF) and draftthe release notes. Despite my request to only read lld/ELF changes,Claude Code also crafted notes for other ports, which I retained sincetheir release notes had been quite sparse for several releases.
-
--print-gc-sections=<file>has been added toredirect garbage collection section listing to a file, avoidingcontamination of stdout with other linker output. (#159706) - A
VersionNodelexer state has been added for betterversion script parsing. This brings the lexer behavior closer to GNU ld.(#174530) - Unversioned undefined symbols now use version index 0, aligning withGNU ld 2.46 behavior. (
#168189) -
.data.rel.ro.hotand.data.rel.ro.unlikelyare now recognized as RELRO sections, allowing profile-guided staticdata partitioning. (#148920) - DTLTO now supports archive members and bitcode members of thinarchives. (
#157043) - For DTLTO,
--thinlto-remote-compiler-prepend-arg=<arg>has beenadded to prepend an argument to the remote compiler's command line. (#162456) - Balanced Partitioning (BP) section ordering now skips input sectionswith null data, and filters out section symbols. (
#149265) ( #151685) - For AArch64, fixed a crash when using
--fix-cortex-a53-843419with synthetic sections andimproved 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 returnvalue 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 andconverting them into GNU Properties. (
#147970) - For ARM, fixed incorrect veneer generation for wraparound branchesat 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 alignmentinformation. (#153935) - For LoongArch, added relocation types for LA32R/LA32S. (
#172618) ( #176312) - For RISC-V, added infrastructure for handling vendor-specificrelocations. (
#159987) - For RISC-V, added support for statically resolved vendor-specificrelocations. (
#169273) - For RISC-V,
-rnow synthesizesR_RISCV_ALIGNat input section start to preserve alignmentinformation during two-stage linking. (#151639)
Besides me, Peter Smith (smithp35) and Jessica Clarke (jrtc27) havedone a lot of reviews.
jrtc27 has done great work simplifying the dynamic relocation system,which is highly appreciated.
I should call out
Link: lld 21 ELFchanges



