1======================== 2lld 13.0.0 Release Notes 3======================== 4 5.. contents:: 6 :local: 7 8Introduction 9============ 10 11This document contains the release notes for the lld linker, release 13.0.0. 12Here we describe the status of lld, including major improvements 13from the previous release. All lld releases may be downloaded 14from the `LLVM releases web site <https://llvm.org/releases/>`_. 15 16Non-comprehensive list of changes in this release 17================================================= 18 19ELF Improvements 20---------------- 21 22* ``-z start-stop-gc`` is now supported and becomes the default. 23 (`D96914 <https://reviews.llvm.org/D96914>`_) 24 (`rG6d2d3bd0 <https://reviews.llvm.org/rG6d2d3bd0a61f5fc7fd9f61f48bc30e9ca77cc619>`_) 25* ``--shuffle-sections=<seed>`` has been changed to ``--shuffle-sections=<section-glob>=<seed>``. 26 If seed is -1, the matched input sections are reversed. 27 (`D98445 <https://reviews.llvm.org/D98445>`_) 28 (`D98679 <https://reviews.llvm.org/D98679>`_) 29* ``-Bsymbolic -Bsymbolic-functions`` has been changed to behave the same as ``-Bsymbolic-functions``. This matches GNU ld. 30 (`D102461 <https://reviews.llvm.org/D102461>`_) 31* ``-Bno-symbolic`` has been added. 32 (`D102461 <https://reviews.llvm.org/D102461>`_) 33* A new linker script command ``OVERWRITE_SECTIONS`` has been added. 34 (`D103303 <https://reviews.llvm.org/D103303>`_) 35* ``-Bsymbolic-non-weak-functions`` has been added as a ``STB_GLOBAL`` subset of ``-Bsymbolic-functions``. 36 (`D102570 <https://reviews.llvm.org/D102570>`_) 37* ``--no-allow-shlib-undefined`` has been improved to catch more cases. 38 (`D101996 <https://reviews.llvm.org/D101996>`_) 39* ``__rela_iplt_start`` is no longer defined for -pie/-shared. 40 This makes GCC/Clang ``-static-pie`` built executables work. 41 (`rG8cb78e99 <https://reviews.llvm.org/rf8cb78e99aae9aa3f89f7bfe667db2c5b767f21f>`_) 42* IRELATIVE/TLSDESC relocations now support ``-z rel``. 43 (`D100544 <https://reviews.llvm.org/D100544>`_) 44* Section groups with a zero flag are now supported. 45 This is used by ``comdat nodeduplicate`` in LLVM IR. 46 (`D96636 <https://reviews.llvm.org/D96636>`_) 47 (`D106228 <https://reviews.llvm.org/D106228>`_) 48* Defined symbols are now resolved before undefined symbols to stabilize the bheavior of archive member extraction. 49 (`D95985 <https://reviews.llvm.org/D95985>`_) 50* ``STB_WEAK`` symbols are now preferred over COMMON symbols as a fix to a ``--fortran-common`` regression. 51 (`D105945 <https://reviews.llvm.org/D105945>`_) 52* Absolute relocations referencing undef weak now produce dynamic relocations for -pie, matching GOT-generating relocations. 53 (`D105164 <https://reviews.llvm.org/D105164>`_) 54* Exported symbols are now communicated to the LTO library so as to make LTO 55 based whole program devirtualization (``-flto=thin -fwhole-program-vtables``) 56 work with shared objects. 57 (`D91583 <https://reviews.llvm.org/D91583>`_) 58* Whole program devirtualization now respects ``local:`` version nodes in a version script. 59 (`D98220 <https://reviews.llvm.org/D98220>`_) 60 (`D98686 <https://reviews.llvm.org/D98686>`_) 61* ``local:`` version nodes in a version script now apply to non-default version symbols. 62 (`D107234 <https://reviews.llvm.org/D107234>`_) 63* If an object file defines both ``foo`` and ``foo@v1``, now only ``foo@v1`` will be in the output. 64 (`D107235 <https://reviews.llvm.org/D107235>`_) 65* Copy relocations on non-default version symbols are now supported. 66 (`D107535 <https://reviews.llvm.org/D107535>`_) 67 68Linker script changes: 69 70* ``.``, ``$``, and double quotes can now be used in symbol names in expressions. 71 (`D98306 <https://reviews.llvm.org/D98306>`_) 72 (`rGe7a7ad13 <https://reviews.llvm.org/rGe7a7ad134fe182aad190cb3ebc441164470e92f5>`_) 73* Fixed value of ``.`` in the output section description of ``.tbss``. 74 (`D107288 <https://reviews.llvm.org/D107288>`_) 75* ``NOLOAD`` sections can now be placed in a ``PT_LOAD`` program header. 76 (`D103815 <https://reviews.llvm.org/D103815>`_) 77* ``OUTPUT_FORMAT(default, big, little)`` now consults ``-EL`` and ``-EB``. 78 (`D96214 <https://reviews.llvm.org/D96214>`_) 79* The ``OVERWRITE_SECTIONS`` command has been added. 80 (`D103303 <https://reviews.llvm.org/D103303>`_) 81* The section order within an ``INSERT AFTER`` command is now preserved. 82 (`D105158 <https://reviews.llvm.org/D105158>`_) 83 84Architecture specific changes: 85 86* aarch64_be is now supported. 87 (`D96188 <https://reviews.llvm.org/D96188>`_) 88* The AMDGPU port now supports ``--amdhsa-code-object-version=4`` object files; 89 (`D95811 <https://reviews.llvm.org/D95811>`_) 90* The ARM port now accounts for PC biases in range extension thunk creation. 91 (`D97550 <https://reviews.llvm.org/D97550>`_) 92* The AVR port now computes ``e_flags``. 93 (`D99754 <https://reviews.llvm.org/D99754>`_) 94* The Mips port now omits unneeded dynamic relocations for PIE non-preemptible TLS. 95 (`D101382 <https://reviews.llvm.org/D101382>`_) 96* The PowerPC port now supports ``--power10-stubs=no`` to omit Power10 instructions from call stubs. 97 (`D94625 <https://reviews.llvm.org/D94625>`_) 98* Fixed a thunk creation bug in the PowerPC port when TOC/NOTOC calls are mixed. 99 (`D101837 <https://reviews.llvm.org/D101837>`_) 100* The RISC-V port now resolves undefined weak relocations to the current location if not using PLT. 101 (`D103001 <https://reviews.llvm.org/D103001>`_) 102* ``R_386_GOTOFF`` relocations from .debug_info are now allowed to be compatible with GCC. 103 (`D95994 <https://reviews.llvm.org/D95994>`_) 104* ``gotEntrySize`` has been added to improve support for the ILP32 ABI of x86-64. 105 (`D102569 <https://reviews.llvm.org/D102569>`_) 106 107Breaking changes 108---------------- 109 110* ``--shuffle-sections=<seed>`` has been changed to ``--shuffle-sections=<section-glob>=<seed>``. 111 Specify ``*`` as ``<section-glob>`` to get the previous behavior. 112 113COFF Improvements 114----------------- 115 116* Avoid thread exhaustion when running on 32 bit Windows. 117 (`D105506 <https://reviews.llvm.org/D105506>`_) 118 119* Improve terminating the process on Windows while a thread pool might be 120 running. (`D102944 <https://reviews.llvm.org/D102944>`_) 121 122MinGW Improvements 123------------------ 124 125* Support for linking directly against a DLL without using an import library 126 has been added. (`D104530 <https://reviews.llvm.org/D104530>`_ and 127 `D104531 <https://reviews.llvm.org/D104531>`_) 128 129* Fix linking with ``--export-all-symbols`` in combination with 130 ``-function-sections``. (`D101522 <https://reviews.llvm.org/D101522>`_ and 131 `D101615 <https://reviews.llvm.org/D101615>`_) 132 133* Fix automatic export of symbols from LTO objects. 134 (`D101569 <https://reviews.llvm.org/D101569>`_) 135 136* Accept more spellings of some options. 137 (`D107237 <https://reviews.llvm.org/D107237>`_ and 138 `D107253 <https://reviews.llvm.org/D107253>`_) 139 140Mach-O Improvements 141------------------- 142 143The Mach-O backend is now able to link several large, real-world programs, 144though we are still working out the kinks. 145 146* arm64 is now supported as a target. (`D88629 <https://reviews.llvm.org/D88629>`_) 147* arm64_32 is now supported as a target. (`D99822 <https://reviews.llvm.org/D99822>`_) 148* Branch-range-extension thunks are now supported. (`D100818 <https://reviews.llvm.org/D100818>`_) 149* ``-dead_strip`` is now supported. (`D103324 <https://reviews.llvm.org/D103324>`_) 150* Support for identical code folding (``--icf=all``) has been added. 151 (`D103292 <https://reviews.llvm.org/D103292>`_) 152* Support for special ``$start`` and ``$end`` symbols for segment & sections has been 153 added. (`D106767 <https://reviews.llvm.org/D106767>`_, `D106629 <https://reviews.llvm.org/D106629>`_) 154* ``$ld$previous`` symbols are now supported. (`D103505 <https://reviews.llvm.org/D103505 >`_) 155* ``$ld$install_name`` symbols are now supported. (`D103746 <https://reviews.llvm.org/D103746>`_) 156* ``__mh_*_header`` symbols are now supported. (`D97007 <https://reviews.llvm.org/D97007>`_) 157* LC_CODE_SIGNATURE is now supported. (`D96164 <https://reviews.llvm.org/D96164>`_) 158* LC_FUNCTION_STARTS is now supported. (`D97260 <https://reviews.llvm.org/D97260>`_) 159* LC_DATA_IN_CODE is now supported. (`D103006 <https://reviews.llvm.org/D103006>`_) 160* Bind opcodes are more compactly encoded. (`D106128 <https://reviews.llvm.org/D106128>`_, 161 `D105075 <https://reviews.llvm.org/D105075>`_) 162* LTO cache support has been added. (`D105922 <https://reviews.llvm.org/D105922>`_) 163* ``-application_extension`` is now supported. (`D105818 <https://reviews.llvm.org/D105818>`_) 164* ``-export_dynamic`` is now partially supported. (`D105482 <https://reviews.llvm.org/D105482>`_) 165* ``-arch_multiple`` is now supported. (`D105450 <https://reviews.llvm.org/D105450>`_) 166* ``-final_output`` is now supported. (`D105449 <https://reviews.llvm.org/D105449>`_) 167* ``-umbrella`` is now supported. (`D105448 <https://reviews.llvm.org/D105448>`_) 168* ``--print-dylib-search`` is now supported. (`D103985 <https://reviews.llvm.org/D103985>`_) 169* ``-force_load_swift_libs`` is now supported. (`D103709 <https://reviews.llvm.org/D103709>`_) 170* ``-reexport_framework``, ``-reexport_library``, ``-reexport-l`` are now supported. 171 (`D103497 <https://reviews.llvm.org/D103497>`_) 172* ``.weak_def_can_be_hidden`` is now supported. (`D101080 <https://reviews.llvm.org/D101080>`_) 173* ``-add_ast_path`` is now supported. (`D100076 <https://reviews.llvm.org/D100076>`_) 174* ``-segprot`` is now supported. (`D99389 <https://reviews.llvm.org/D99389>`_) 175* ``-dependency_info`` is now partially supported. (`D98559 <https://reviews.llvm.org/D98559>`_) 176* ``--time-trace`` is now supported. (`D98419 <https://reviews.llvm.org/D98419>`_) 177* ``-mark_dead_strippable_dylib`` is now supported. (`D98262 <https://reviews.llvm.org/D98262>`_) 178* ``-[un]exported_symbol[s_list]`` is now supported. (`D98223 <https://reviews.llvm.org/D98223>`_) 179* ``-flat_namespace`` is now supported. (`D97641 <https://reviews.llvm.org/D97641>`_) 180* ``-rename_section`` and ``-rename_segment`` are now supported. (`D97600 <https://reviews.llvm.org/D97600>`_) 181* ``-bundle_loader`` is now supported. (`D95913 <https://reviews.llvm.org/D95913>`_) 182* ``-map`` is now partially supported. (`D98323 <https://reviews.llvm.org/D98323>`_) 183 184There were numerous other bug-fixes as well. 185 186WebAssembly Improvements 187------------------------ 188 189