lld 15.0.0 Release Notes

Introduction

This document contains the release notes for the lld linker, release 15.0.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

  • -z pack-relative-relocs is now available to support DT_RELR for glibc 2.36+. (D120701)

  • --no-fortran-common (pre 12.0.0 behavior) is now the default.

  • --load-pass-plugin has been added to load a new pass manager plugin. (D120490)

  • --android-memtag-{mode=,stack,heap} have been added to synthesize SHT_NOTE for memory tags on Android. (D119384)

  • FORCE_LLD_DIAGNOSTICS_CRASH environment variable is now available to force LLD to crash. (D128195)

  • --wrap semantics have been refined. (rG7288b85cc80f1ce5509aeea860e6b4232cd3ca01) (D118756) (D124056)

  • --build-id={md5,sha1} are now implemented with truncated BLAKE3. (D121531)

  • --emit-relocs: .rel[a].eh_frame relocation offsets are now adjusted. (D122459)

  • --emit-relocs: fixed missing STT_SECTION when the first input section is synthetic. (D122463)

  • (TYPE=<value>) can now be used in linker scripts. (D118840)

  • Local symbol initialization is now performed in parallel. (D119909) (D120626)

Breaking changes

  • Archives are now parsed as --start-lib object files. If a member is neither an ELF relocatable object file nor an LLVM bitcode file, ld.lld will give a warning. (D119074)

  • The GNU ld incompatible --no-define-common has been removed.

  • The obscure -dc/-dp options have been removed. (D119108)

  • -d is now ignored.

  • If a prevailing COMDAT group defines STB_WEAK symbol, having a STB_GLOBAL symbol in a non-prevailing group is now rejected with a diagnostic. (D120626)

  • Support for the legacy .zdebug format has been removed. Run objcopy --decompress-debug-sections in case old object files use .zdebug. (D126793)

  • --time-trace-file=<file> has been removed. Use --time-trace=<file> instead. (D128451)

COFF Improvements

  • Added autodetection of MSVC toolchain, a la clang-cl. Also added /winsysroot: support for explicit specification of MSVC toolchain location, similar to clang-cl’s /winsysroot. For now, /winsysroot: requires also passing in an explicit /machine: flag. (D118070)

MinGW Improvements

  • The --disable-reloc-section option is now supported. (D127478)

MachO Improvements

  • We now support proper relocation and pruning of EH frames. Note: this comes at some performance overhead on x86_64 builds, and we recommend adding the -femit-compact-unwind=no-compact-unwind compile flag to avoid it. (D129540, D122258)

New flags

  • -load_hidden and -hidden-l are now supported. (D130473, D130529)

  • -alias is now supported. (D129938)

  • -no_exported_symbols and -exported_symbols_list <empty file> are now supported. (D127562)

  • -w – to suppress warnings – is now supported. (D127564)

  • -non_global_symbols_strip_list, -non_global_symbols_no_strip_list, and -x are now supported. (D126046)

  • --icf=safe is now supported. (D128938, D123752)

  • -why_live is now supported. (D120377)

  • -pagezero_size is now supported. (D118724)

Improvements

  • Linker optimization hints are now supported. (D129427, D129059, D128942, D128093)

  • Rebase opcodes are now encoded more compactly. (D130180, D128798)

  • C-strings are now aligned more compactly. (D121342)

  • --deduplicate-literals (and --icf={safe,all}) now fold the __cfstring section. (D130134, D120137)

  • ICF now folds the __objc_classrefs section. (D121053)

  • ICF now folds functions with identical LSDAs. (D129830)

  • STABS entries for folded functions are now omitted. (D123252)

  • __objc_imageinfo sections are now folded. (D130125)

  • Dylibs with LC_DYLD_EXPORTS_TRIE can now be read. (D129430)

  • Writing zippered dylibs is now supported. (D124887)

  • C-string literals are now included in the mapfile. (D118077)

  • Symbol names in several more diagnostics are now demangled. (D130490, D127110, D125732)

  • Source information is now included in symbol error messages. (D128425, D128184)

  • Numerous other improvements were made to diagnostic messages. (D127753, D127696, D127670, D118903, D118798)

  • Many performance and memory improvements were made. (D130000, D128298, D128290, D126800, D126785, D121052)

  • Order files and call graph sorting can now be used together. (D117354)

  • Give LTO more precise symbol resolutions, which allows optimizations to be more effective. (D119506, D119372, D119767)

  • Added partial support for linking object files built with DTrace probes. (D129062)

Fixes

  • Programs using Swift linked with the 14.0 SDK but an older deployment target no longer crash at startup when running on older iOS versions. This is because we now correctly support $ld$previous symbols that contain an explicit symbol name. (D130725)

  • Match ld64’s behavior when an archive is specified both via LC_LINKER_OPTION and via the command line. (D129556)

  • -ObjC now correctly loads archives with Swift sections. (D125250)

  • -lto_object_path now accepts a filename (instead of just a directory name.) (D129705)

  • The LC_UUID hash now includes the output file’s name. (D122843)

  • -flat_namespace now correctly makes all extern symbols in a dylib interposable. (D119294)

  • Fixed compact unwind output when linking on 32-bit hosts. (D129363)

  • Exporting private symbols no longer triggers an assertion. (D124143)

  • MacOS-only .tbd files are now supported when targeting Catalyst. (D124336)

  • Thunk symbols now have local visibility, avoiding false duplicate symbol errors. (D122624)

  • Fixed handling of relocatable object files within frameworks. (D114841)