1=========================== 2lld |release| Release Notes 3=========================== 4 5.. contents:: 6 :local: 7 8.. only:: PreRelease 9 10 .. warning:: 11 These are in-progress notes for the upcoming LLVM |release| release. 12 Release notes for previous releases can be found on 13 `the Download Page <https://releases.llvm.org/download.html>`_. 14 15Introduction 16============ 17 18This document contains the release notes for the lld linker, release |release|. 19Here we describe the status of lld, including major improvements 20from the previous release. All lld releases may be downloaded 21from the `LLVM releases web site <https://llvm.org/releases/>`_. 22 23Non-comprehensive list of changes in this release 24================================================= 25 26ELF Improvements 27---------------- 28* ``--package-metadata=`` has been added to create package metadata notes 29 (`D131439 <https://reviews.llvm.org/D131439>`_) 30 31* ``-z pack-relative-relocs`` is now available to support ``DT_RELR`` for glibc 2.36+. 32 (`D120701 <https://reviews.llvm.org/D120701>`_) 33* ``--no-fortran-common`` (pre 12.0.0 behavior) is now the default. 34* ``--load-pass-plugin`` has been added to load a new pass manager plugin. 35 (`D120490 <https://reviews.llvm.org/D120490>`_) 36* ``--android-memtag-{mode=,stack,heap}`` have been added to synthesize SHT_NOTE for memory tags on Android. 37 (`D119384 <https://reviews.llvm.org/D119384>`_) 38* ``FORCE_LLD_DIAGNOSTICS_CRASH`` environment variable is now available to force LLD to crash. 39 (`D128195 <https://reviews.llvm.org/D128195>`_) 40* ``--wrap`` semantics have been refined. 41 (`rG7288b85cc80f1ce5509aeea860e6b4232cd3ca01 <https://reviews.llvm.org/rG7288b85cc80f1ce5509aeea860e6b4232cd3ca01>`_) 42 (`D118756 <https://reviews.llvm.org/D118756>`_) 43 (`D124056 <https://reviews.llvm.org/D124056>`_) 44* ``--build-id={md5,sha1}`` are now implemented with truncated BLAKE3. 45 (`D121531 <https://reviews.llvm.org/D121531>`_) 46* ``--emit-relocs``: ``.rel[a].eh_frame`` relocation offsets are now adjusted. 47 (`D122459 <https://reviews.llvm.org/D122459>`_) 48* ``--emit-relocs``: fixed missing ``STT_SECTION`` when the first input section is synthetic. 49 (`D122463 <https://reviews.llvm.org/D122463>`_) 50* ``(TYPE=<value>)`` can now be used in linker scripts. 51 (`D118840 <https://reviews.llvm.org/D118840>`_) 52* Local symbol initialization is now performed in parallel. 53 (`D119909 <https://reviews.llvm.org/D119909>`_) 54 (`D120626 <https://reviews.llvm.org/D120626>`_) 55 56Breaking changes 57---------------- 58 59* Archives are now parsed as ``--start-lib`` object files. If a member is neither 60 an ELF relocatable object file nor an LLVM bitcode file, ld.lld will give a warning. 61 (`D119074 <https://reviews.llvm.org/D119074>`_) 62* The GNU ld incompatible ``--no-define-common`` has been removed. 63* The obscure ``-dc``/``-dp`` options have been removed. 64 (`D119108 <https://reviews.llvm.org/D119108>`_) 65* ``-d`` is now ignored. 66* 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. 67 (`D120626 <https://reviews.llvm.org/D120626>`_) 68* Support for the legacy ``.zdebug`` format has been removed. Run 69 ``objcopy --decompress-debug-sections`` in case old object files use ``.zdebug``. 70 (`D126793 <https://reviews.llvm.org/D126793>`_) 71* ``--time-trace-file=<file>`` has been removed. 72 Use ``--time-trace=<file>`` instead. 73 (`D128451 <https://reviews.llvm.org/D128451>`_) 74 75COFF Improvements 76----------------- 77 78* Added autodetection of MSVC toolchain, a la clang-cl. Also added 79 ``/winsysroot:`` support for explicit specification of MSVC toolchain 80 location, similar to clang-cl's ``/winsysroot``. For now, 81 ``/winsysroot:`` requires also passing in an explicit ``/machine:`` flag. 82 (`D118070 <https://reviews.llvm.org/D118070>`_) 83* ... 84 85MinGW Improvements 86------------------ 87 88* The ``--disable-reloc-section`` option is now supported. 89 (`D127478 <https://reviews.llvm.org/D127478>`_) 90 91MachO Improvements 92------------------ 93 94* We now support proper relocation and pruning of EH frames. **Note:** this 95 comes at some performance overhead on x86_64 builds, and we recommend adding 96 the ``-femit-compact-unwind=no-compact-unwind`` compile flag to avoid it. 97 (`D129540 <https://reviews.llvm.org/D129540>`_, 98 `D122258 <https://reviews.llvm.org/D122258>`_) 99 100New flags 101######### 102 103* ``-load_hidden`` and ``-hidden-l`` are now supported. 104 (`D130473 <https://reviews.llvm.org/D130473>`_, 105 `D130529 <https://reviews.llvm.org/D130529>`_) 106* ``-alias`` is now supported. (`D129938 <https://reviews.llvm.org/D129938>`_) 107* ``-no_exported_symbols`` and ``-exported_symbols_list <empty file>`` are now 108 supported. (`D127562 <https://reviews.llvm.org/D127562>`_) 109* ``-w`` -- to suppress warnings -- is now supported. 110 (`D127564 <https://reviews.llvm.org/D127564>`_) 111* ``-non_global_symbols_strip_list``, ``-non_global_symbols_no_strip_list``, and 112 ``-x`` are now supported. (`D126046 <https://reviews.llvm.org/D126046>`_) 113* ``--icf=safe`` is now supported. 114 (`D128938 <https://reviews.llvm.org/D128938>`_, 115 `D123752 <https://reviews.llvm.org/D123752>`_) 116* ``-why_live`` is now supported. 117 (`D120377 <https://reviews.llvm.org/D120377>`_) 118* ``-pagezero_size`` is now supported. 119 (`D118724 <https://reviews.llvm.org/D118724>`_) 120 121Improvements 122############ 123 124* Linker optimization hints are now supported. 125 (`D129427 <https://reviews.llvm.org/D129427>`_, 126 `D129059 <https://reviews.llvm.org/D129059>`_, 127 `D128942 <https://reviews.llvm.org/D128942>`_, 128 `D128093 <https://reviews.llvm.org/D128093>`_) 129* Rebase opcodes are now encoded more compactly. 130 (`D130180 <https://reviews.llvm.org/D130180>`_, 131 `D128798 <https://reviews.llvm.org/D128798>`_) 132* C-strings are now aligned more compactly. 133 (`D121342 <https://reviews.llvm.org/D121342>`_) 134* ``--deduplicate-literals`` (and ``--icf={safe,all}``) now fold the 135 ``__cfstring`` section. 136 (`D130134 <https://reviews.llvm.org/D130134>`_, 137 `D120137 <https://reviews.llvm.org/D120137>`_) 138* ICF now folds the ``__objc_classrefs`` section. 139 (`D121053 <https://reviews.llvm.org/D121053>`_) 140* ICF now folds functions with identical LSDAs. 141 (`D129830 <https://reviews.llvm.org/D129830>`_) 142* STABS entries for folded functions are now omitted. 143 (`D123252 <https://reviews.llvm.org/D123252>`_) 144* ``__objc_imageinfo`` sections are now folded. 145 (`D130125 <https://reviews.llvm.org/D130125>`_) 146* Dylibs with ``LC_DYLD_EXPORTS_TRIE`` can now be read. 147 (`D129430 <https://reviews.llvm.org/D129430>`_) 148* Writing zippered dylibs is now supported. 149 (`D124887 <https://reviews.llvm.org/D124887>`_) 150* C-string literals are now included in the mapfile. 151 (`D118077 <https://reviews.llvm.org/D118077>`_) 152* Symbol names in several more diagnostics are now demangled. 153 (`D130490 <https://reviews.llvm.org/D130490>`_, 154 `D127110 <https://reviews.llvm.org/D127110>`_, 155 `D125732 <https://reviews.llvm.org/D125732>`_) 156* Source information is now included in symbol error messages. 157 (`D128425 <https://reviews.llvm.org/D128425>`_, 158 `D128184 <https://reviews.llvm.org/D128184>`_) 159* Numerous other improvements were made to diagnostic messages. 160 (`D127753 <https://reviews.llvm.org/D127753>`_, 161 `D127696 <https://reviews.llvm.org/D127696>`_, 162 `D127670 <https://reviews.llvm.org/D127670>`_, 163 `D118903 <https://reviews.llvm.org/D118903>`_, 164 `D118798 <https://reviews.llvm.org/D118798>`_) 165* Many performance and memory improvements were made. 166 (`D130000 <https://reviews.llvm.org/D130000>`_, 167 `D128298 <https://reviews.llvm.org/D128298>`_, 168 `D128290 <https://reviews.llvm.org/D128290>`_, 169 `D126800 <https://reviews.llvm.org/D126800>`_, 170 `D126785 <https://reviews.llvm.org/D126785>`_, 171 `D121052 <https://reviews.llvm.org/D121052>`_) 172* Order files and call graph sorting can now be used together. 173 (`D117354 <https://reviews.llvm.org/D117354>`_) 174* Give LTO more precise symbol resolutions, which allows optimizations to be 175 more effective. 176 (`D119506 <https://reviews.llvm.org/D119506>`_, 177 `D119372 <https://reviews.llvm.org/D119372>`_, 178 `D119767 <https://reviews.llvm.org/D119767>`_) 179* Added partial support for linking object files built with DTrace probes. 180 (`D129062 <https://reviews.llvm.org/D129062>`_) 181 182Fixes 183##### 184 185* Programs using Swift linked with the 14.0 SDK but an older deployment target 186 no longer crash at startup when running on older iOS versions. This is because 187 we now correctly support ``$ld$previous`` symbols that contain an explicit 188 symbol name. (`D130725 <https://reviews.llvm.org/D130725>`_) 189* Match ld64's behavior when an archive is specified both via 190 ``LC_LINKER_OPTION`` and via the command line. 191 (`D129556 <https://reviews.llvm.org/D129556>`_) 192* ``-ObjC`` now correctly loads archives with Swift sections. 193 (`D125250 <https://reviews.llvm.org/D125250>`_) 194* ``-lto_object_path`` now accepts a filename (instead of just a directory 195 name.) (`D129705 <https://reviews.llvm.org/D129705>`_) 196* The ``LC_UUID`` hash now includes the output file's name. 197 (`D122843 <https://reviews.llvm.org/D122843>`_) 198* ``-flat_namespace`` now correctly makes all extern symbols in a dylib 199 interposable. (`D119294 <https://reviews.llvm.org/D119294>`_) 200* Fixed compact unwind output when linking on 32-bit hosts. 201 (`D129363 <https://reviews.llvm.org/D129363>`_) 202* Exporting private symbols no longer triggers an assertion. 203 (`D124143 <https://reviews.llvm.org/D124143>`_) 204* MacOS-only ``.tbd`` files are now supported when targeting Catalyst. 205 (`D124336 <https://reviews.llvm.org/D124336>`_) 206* Thunk symbols now have local visibility, avoiding false duplicate symbol 207 errors. (`D122624 <https://reviews.llvm.org/D122624>`_) 208* Fixed handling of relocatable object files within frameworks. 209 (`D114841 <https://reviews.llvm.org/D114841>`_) 210 211WebAssembly Improvements 212------------------------ 213 214