xref: /freebsd/contrib/llvm-project/lld/docs/ReleaseNotes.rst (revision 9c77fb6aaa366cbabc80ee1b834bcfe4df135491)
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* Added ``-z dynamic-undefined-weak`` to make undefined weak symbols dynamic
29  when the dynamic symbol table is present.
30  (`#143831 <https://github.com/llvm/llvm-project/pull/143831>`_)
31* For ``-z undefs`` (default for ``-shared``), relocations referencing undefined
32  strong symbols now behave like relocations referencing undefined weak symbols.
33* ``--why-live=<glob>`` prints for each symbol matching ``<glob>`` a chain of
34  items that kept it live during garbage collection. This is inspired by the
35  Mach-O LLD feature of the same name.
36* ``--thinlto-distributor=`` and ``--thinlto-remote-compiler=`` options are
37  added to support Integrated Distributed ThinLTO.
38  (`#142757 <https://github.com/llvm/llvm-project/pull/142757>`_)
39
40* Linker script ``OVERLAY`` descriptions now support virtual memory regions
41  (e.g. ``>region``) and ``NOCROSSREFS``.
42* When the last ``PT_LOAD`` segment is executable and includes BSS sections,
43  its ``p_memsz`` member is now correct.
44  (`#139207 <https://github.com/llvm/llvm-project/pull/139207>`_)
45* Spurious ``ASSERT`` errors before the layout converges are now fixed.
46
47* For ARM and AArch64, ``--xosegment`` and ``--no-xosegment`` control whether
48  to place executable-only and readable-executable sections in the same
49  segment. The default option is ``--no-xosegment``.
50  (`#132412 <https://github.com/llvm/llvm-project/pull/132412>`_)
51* For AArch64, added support for the ``SHF_AARCH64_PURECODE`` section flag,
52  which indicates that the section only contains program code and no data.
53  An output section will only have this flag set if all input sections also
54  have it set. (`#125689 <https://github.com/llvm/llvm-project/pull/125689>`_,
55  `#134798 <https://github.com/llvm/llvm-project/pull/134798>`_)
56* For AArch64 and ARM, added ``-zexecute-only-report``, which checks for
57  missing ``SHF_AARCH64_PURECODE`` and ``SHF_ARM_PURECODE`` section flags
58  on executable sections.
59  (`#128883 <https://github.com/llvm/llvm-project/pull/128883>`_)
60* For AArch64, ``-z nopac-plt`` has been added.
61* For AArch64 and X86_64, added ``--branch-to-branch``, which rewrites branches
62  that point to another branch instruction to instead branch directly to the
63  target of the second instruction. Enabled by default at ``-O2``.
64* For AArch64, added support for ``-zgcs-report-dynamic``, enabling checks for
65  GNU GCS Attribute Flags in Dynamic Objects when GCS is enabled. Inherits value
66  from ``-zgcs-report`` (capped at ``warning`` level) unless user-defined,
67  ensuring compatibility with GNU ld linker.
68* The default Hexagon architecture version in ELF object files produced by
69  lld is changed to v68. This change is only effective when the version is
70  not provided in the command line by the user and cannot be inferred from
71  inputs.
72* For LoongArch, the initial-exec to local-exec TLS optimization has been implemented.
73* For LoongArch, several relaxation optimizations are supported, including relaxation for
74  ``R_LARCH_PCALA_HI20/LO12`` and ``R_LARCH_GOT_PC_HI20/LO12`` relocations, instruction
75  relaxation for ``R_LARCH_CALL36``, TLS local-exec (``LE``)/global dynamic (``GD``)/
76  local dynamic (``LD``) model relaxation, and TLSDESC code sequence relaxation.
77* For RISCV, an oscillation bug due to call relaxation is now fixed.
78  (`#142899 <https://github.com/llvm/llvm-project/pull/142899>`_)
79* For x86-64, the ``.ltext`` section is now placed before ``.rodata``.
80
81Breaking changes
82----------------
83* Executable-only and readable-executable sections are now allowed to be placed
84  in the same segment by default. Pass ``--xosegment`` to lld in order to get
85  the old behavior back.
86
87* When using ``--no-pie`` without a ``SECTIONS`` command, the linker uses the
88  target's default image base. If ``-Ttext=`` or ``--section-start`` specifies
89  an output section address below this base, there will now be an error.
90  ``--image-base`` can be set at a lower address to fix the error.
91  (`#140187 <https://github.com/llvm/llvm-project/pull/140187>`_)
92
93COFF Improvements
94-----------------
95* ``/thinlto-distributor`` and ``/thinlto-remote-compiler`` options
96  added to support Integrated Distributed ThinLTO.
97  (`#147265 <https://github.com/llvm/llvm-project/pull/147265>`_)
98
99MinGW Improvements
100------------------
101
102MachO Improvements
103------------------
104
105WebAssembly Improvements
106------------------------
107
108Fixes
109#####
110