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 29* ``--export-dynamic-symbol-list`` has been added. 30 (`D107317 <https://reviews.llvm.org/D107317>`_) 31* ``--why-extract`` has been added to query why archive members/lazy object files are extracted. 32 (`D109572 <https://reviews.llvm.org/D109572>`_) 33* If ``-Map`` is specified, ``--cref`` will be printed to the specified file. 34 (`D114663 <https://reviews.llvm.org/D114663>`_) 35* ``-z bti-report`` and ``-z cet-report`` are now supported. 36 (`D113901 <https://reviews.llvm.org/D113901>`_) 37* ``--lto-pgo-warn-mismatch`` has been added. 38 (`D104431 <https://reviews.llvm.org/D104431>`_) 39* Archives without an index (symbol table) are now supported and work with 40 ``--warn-backrefs``. One may build such an archive with ``llvm-ar rcS 41 [--thin]`` to save space. 42 (`D117284 <https://reviews.llvm.org/D117284>`_) 43 The archive index may be `entirely ignored <https://reviews.llvm.org/D119074>`_ 44 in a future release. 45* No longer deduplicate local symbol names at the default optimization level of ``-O1``. 46 This results in a larger ``.strtab`` (usually less than 1%) but a faster link 47 time. Use optimization level ``-O2`` to restore the deduplication. The ``-O2`` 48 deduplication may be dropped in the future to help parallel ``.symtab`` write. 49* In relocatable output, relocations to discarded symbols now use tombstone 50 values. 51 (`D116946 <https://reviews.llvm.org/D116946>`_) 52* Orphan section placement now picks a more suitable segment. Previously the 53 algorithm might pick a readonly segment for a writable orphan section and make 54 the segment writable. 55 (`D111717 <https://reviews.llvm.org/D111717>`_) 56* An empty output section moved by an ``INSERT`` comment now gets appropriate 57 flags. 58 (`D118529 <https://reviews.llvm.org/D118529>`_) 59* Negation in a memory region attribute is now correctly handled. 60 (`D113771 <https://reviews.llvm.org/D113771>`_) 61* ``--compress-debug-sections=zlib`` is now run in parallel. ``{clang,gcc} -gz`` link 62 actions are significantly faster. 63 (`D117853 <https://reviews.llvm.org/D117853>`_) 64* "relocation out of range" diagnostics and a few uncommon diagnostics 65 now report an object file location beside a source file location. 66 (`D112518 <https://reviews.llvm.org/D117853>`_) 67* The write of ``.rela.dyn`` and ``SHF_MERGE|SHF_STRINGS`` sections (e.g. 68 ``.debug_str``) is now run in parallel. 69 70Architecture specific changes: 71 72* The AArch64 port now supports adrp+ldr and adrp+add optimizations. 73 ``--no-relax`` can suppress the optimization. 74 (`D112063 <https://reviews.llvm.org/D112063>`_) 75 (`D117614 <https://reviews.llvm.org/D117614>`_) 76* The x86-32 port now supports TLSDESC (``-mtls-dialect=gnu2``). 77 (`D112582 <https://reviews.llvm.org/D112582>`_) 78* The x86-64 port now handles non-RAX/non-adjacent ``R_X86_64_GOTPC32_TLSDESC`` 79 and ``R_X86_64_TLSDESC_CALL`` (``-mtls-dialect=gnu2``). 80 (`D114416 <https://reviews.llvm.org/D114416>`_) 81* The x86-32 and x86-64 ports now support mixed TLSDESC and TLS GD, i.e. mixing 82 objects compiled with and without ``-mtls-dialect=gnu2`` referencing the same 83 TLS variable is now supported. 84 (`D114416 <https://reviews.llvm.org/D114416>`_) 85* For x86-64, ``--no-relax`` now suppresses ``R_X86_64_GOTPCRELX`` and 86 ``R_X86_64_REX_GOTPCRELX`` GOT optimization 87 (`D113615 <https://reviews.llvm.org/D113615>`_) 88* ``R_X86_64_PLTOFF64`` is now supported. 89 (`D112386 <https://reviews.llvm.org/D112386>`_) 90* ``R_AARCH64_NONE``, ``R_PPC_NONE``, and ``R_PPC64_NONE`` in input REL 91 relocation sections are now supported. 92 93Breaking changes 94---------------- 95 96* ``e_entry`` no longer falls back to the address of ``.text`` if the entry symbol does not exist. 97 Instead, a value of 0 will be written. 98 (`D110014 <https://reviews.llvm.org/D110014>`_) 99* ``--lto-pseudo-probe-for-profiling`` has been removed. In LTO, the compiler 100 enables this feature automatically. 101 (`D110209 <https://reviews.llvm.org/D110209>`_) 102* Use of ``--[no-]define-common``, ``-d``, ``-dc``, and ``-dp`` will now get a 103 warning. They will be removed or ignored in 15.0.0. 104 (`llvm-project#53660 <https://github.com/llvm/llvm-project/issues/53660>`_) 105 106COFF Improvements 107----------------- 108 109* Correctly handle a signed immediate offset in ARM64 adr/adrp relocations. 110 (`D114347 <https://reviews.llvm.org/D114347>`_) 111 112* Omit section and label symbols from the symbol table. 113 (`D113866 <https://reviews.llvm.org/D113866>`_) 114 115MinGW Improvements 116------------------ 117 118* ``--heap`` is now handled. 119 (`D118405 <https://reviews.llvm.org/D118405>`_) 120 121Mach-O Improvements 122------------------- 123 124* The ``ld64.lld.darwinnew`` symlink has been removed. Use ``ld64.lld`` to 125 invoke the Mach-O backend from now on. Moreover, the symlink 126 ``ld64.lld.darwinold`` -- and the old Mach-O LLD code that it pointed to -- 127 have been removed. (`D114842 <https://reviews.llvm.org/D114842>`_) 128* The "cannot export hidden symbol" error has been downgraded to a warning. 129 (`D107011 <https://reviews.llvm.org/D107011>`_) 130* Common bitcode symbols are now supported. 131 (`D107027 <https://reviews.llvm.org/D107027>`_) 132* Weak references in bitcode are now supported. 133 (`D115949 <https://reviews.llvm.org/D115949>`_) 134* Thunk insertion now works more reliably. 135 (`D108897 <https://reviews.llvm.org/D108897>`_, 136 `D108924 <https://reviews.llvm.org/D108924>`_, 137 `D109079 <https://reviews.llvm.org/D109079>`_, 138 `D116705 <https://reviews.llvm.org/D116705>`_) 139* ``-ObjC`` now loads archive members before the symbol resolution phase. 140 (`D108781 <https://reviews.llvm.org/D108781>`_) 141* ``-oso_prefix`` is now supported. 142 (`D112291 <https://reviews.llvm.org/D112291>`_) 143* Properly encode binaries with zero exported symbols. Tools like 144 ``codesign_allocate`` no longer choke on those binaries. 145 (`D112589 <https://reviews.llvm.org/D112589>`_) 146* We no longer treat architecture mismatches as a fatal error. Use 147 ``-arch_errors_fatal`` if that behavior is still desired. 148 (`D113082 <https://reviews.llvm.org/D113082>`_) 149* Several performance improvements were done to speed LLD up on projects with 150 a lot of framework flags and library lookups. Large Swift-based projects 151 will benefit significantly. 152 (`D113073 <https://reviews.llvm.org/D113073>`_, 153 `D113063 <https://reviews.llvm.org/D113063>`_, 154 `D113153 <https://reviews.llvm.org/D113153>`_, 155 `D113235 <https://reviews.llvm.org/D113235>`_) 156* Several memory-reduction optimizations were done to reduce LLD's RSS 157 footprint. 158 (`D113813 <https://reviews.llvm.org/D113813>`_, 159 `D113818 <https://reviews.llvm.org/D113818>`_) 160* Symbol patterns from ``-[un]exported_symbols_list`` are now processed in 161 parallel. (`D113820 <https://reviews.llvm.org/D113820>`_) 162* ``.weak_def_can_be_hidden`` symbols can now be exported. 163 (`D113167 <https://reviews.llvm.org/D113167>`_) 164* ``-S`` -- to omit debug info -- is now handled. 165 (`D112594 <https://reviews.llvm.org/D112594>`_) 166* ``-v`` now writes to stderr instead of stdout. 167 (`D113020 <https://reviews.llvm.org/D113020>`_) 168* Private externs with GOT relocations are now marked as LOCAL in the indirect 169 symbol table. This allows ``strip -x`` to remove more symbols. 170 (`D111852 <https://reviews.llvm.org/D111852>`_) 171* We no longer generate bogus addresses when ``__TEXT,__gcc_except_tab`` is 172 renamed. (`D113582 <https://reviews.llvm.org/D113582>`_) 173* Unreferenced weak dylib symbols no longer trigger fetches from an archive. 174 (`D115092 <https://reviews.llvm.org/D115092>`_) 175* ``$ld$hide`` symbols are now supported. 176 (`D115775 <https://reviews.llvm.org/D115775>`_) 177* Symbols imported via ``-weak_framework`` are now properly marked as weak refs. 178 (`D114397 <https://reviews.llvm.org/D114397>`_) 179* ``--warn-dylib-install-name`` and ``--no-warn-dylib-install-name`` were added 180 to toggle LLD-specific warnings around the use of ``-install_name``. 181 (`D113534 <https://reviews.llvm.org/D113534>`_) 182* Passing both ``--icf=all`` and ``-no_deduplicate`` no longer results in a 183 warning. (`D110672 <https://reviews.llvm.org/D110672>`_) 184* ICF now deduplicates functions with (identical) unwind info too. 185 (`D109946 <https://reviews.llvm.org/D109946>`_) 186* We now support ordering sections based on call graph profile data. 187 (`D112164 <https://reviews.llvm.org/D112164>`_) 188* Map file output now proceeds in parallel with output of the binary. 189 (`D117069 <https://reviews.llvm.org/D117069>`_) 190* The map file now contains dead-stripped symbols too. 191 (`D114737 <https://reviews.llvm.org/D114737>`_) 192* Multiple TLV sections with different alignments are now handled properly. 193 (`D116263 <https://reviews.llvm.org/D116263>`_) 194* ``--start-lib`` and ``--end-lib`` are now supported. 195 (`D116913 <https://reviews.llvm.org/D116913>`_) 196* ``-noall_load`` is now supported. 197 (`D117629 <https://reviews.llvm.org/D117629>`_) 198* ``-add_empty_section`` is now supported. 199 (`D117749 <https://reviews.llvm.org/D117749>`_) 200 201WebAssembly Improvements 202------------------------ 203 204