xref: /freebsd/contrib/llvm-project/lld/docs/ReleaseNotes.rst (revision dab59af3bcc7cb7ba01569d3044894b3e860ad56)
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* Experimental CREL relocations with explicit addends are now supported using the
30  temporary section type code 0x40000020 (``clang -c -Wa,--crel,--allow-experimental-crel``).
31  LLVM will change the code and break compatibility (Clang and lld of different
32  versions are not guaranteed to cooperate, unlike other features). CREL with
33  implicit addends are not supported.
34  (`#98115 <https://github.com/llvm/llvm-project/pull/98115>`_)
35* ``EI_OSABI`` in the output is now inferred from input object files.
36  (`#97144 <https://github.com/llvm/llvm-project/pull/97144>`_)
37* ``--compress-sections <section-glib>={none,zlib,zstd}[:level]`` is added to compress
38  matched output sections without the ``SHF_ALLOC`` flag.
39  (`#84855 <https://github.com/llvm/llvm-project/pull/84855>`_)
40  (`#90567 <https://github.com/llvm/llvm-project/pull/90567>`_)
41* The default compression level for zlib is now independent of linker
42  optimization level (``Z_BEST_SPEED``).
43* zstd compression parallelism no longer requires ``ZSTD_MULITHREAD`` build.
44* ``GNU_PROPERTY_AARCH64_FEATURE_PAUTH`` notes, ``R_AARCH64_AUTH_ABS64`` and
45  ``R_AARCH64_AUTH_RELATIVE`` relocations are now supported.
46  (`#72714 <https://github.com/llvm/llvm-project/pull/72714>`_)
47* ``--no-allow-shlib-undefined`` now rejects non-exported definitions in the
48  ``def-hidden.so ref.so`` case.
49  (`#86777 <https://github.com/llvm/llvm-project/issues/86777>`_)
50* ``--debug-names`` is added to create a merged ``.debug_names`` index
51  from input ``.debug_names`` sections. Type units are not handled yet.
52  (`#86508 <https://github.com/llvm/llvm-project/pull/86508>`_)
53* ``--enable-non-contiguous-regions`` option allows automatically packing input
54  sections into memory regions by automatically spilling to later matches if a
55  region would overflow. This reduces the toil of manually packing regions
56  (typical for embedded). It also makes full LTO feasible in such cases, since
57  IR merging currently prevents the linker script from referring to input
58  files. (`#90007 <https://github.com/llvm/llvm-project/pull/90007>`_)
59* ``--default-script`/``-dT`` is implemented to specify a default script that is processed
60  if ``--script``/``-T`` is not specified.
61  (`#89327 <https://github.com/llvm/llvm-project/pull/89327>`_)
62* ``--force-group-allocation`` is implemented to discard ``SHT_GROUP`` sections
63  and combine relocation sections if their relocated section group members are
64  placed to the same output section.
65  (`#94704 <https://github.com/llvm/llvm-project/pull/94704>`_)
66* ``--build-id`` now defaults to generating a 20-byte digest ("sha1") instead
67  of 8-byte ("fast"). This improves compatibility with RPM packaging tools.
68  (`#93943 <https://github.com/llvm/llvm-project/pull/93943>`_)
69* ``-z lrodata-after-bss`` is implemented to place ``.lrodata`` after ``.bss``.
70  (`#81224 <https://github.com/llvm/llvm-project/pull/81224>`_)
71* ``--export-dynamic`` no longer creates dynamic sections for ``-no-pie`` static linking.
72* ``--lto-emit-asm`` is now added as the canonical spelling of ``--plugin-opt=emit-llvm``.
73* ``--lto-emit-llvm`` now uses the pre-codegen module.
74  (`#97480 <https://github.com/llvm/llvm-project/pull/97480>`_)
75* When AArch64 PAuth is enabled, ``-z pack-relative-relocs`` now encodes ``R_AARCH64_AUTH_RELATIVE`` relocations in ``.rela.auth.dyn``.
76  (`#96496 <https://github.com/llvm/llvm-project/pull/96496>`_)
77* ``-z gcs`` and ``-z gcs-report`` are now supported for AArch64 Guarded Control Stack extension.
78* ``-r`` now forces ``-Bstatic``.
79* Thumb2 PLT is now supported for Cortex-M processors.
80  (`#93644 <https://github.com/llvm/llvm-project/pull/93644>`_)
81* ``DW_EH_sdata4`` of addresses larger than 0x80000000 is now supported for MIPS32.
82  (`#92438 <https://github.com/llvm/llvm-project/pull/92438>`_)
83* Certain unknown section types are rejected.
84  (`#85173 <https://github.com/llvm/llvm-project/pull/85173>`_)
85* ``PROVIDE(lhs = rhs) PROVIDE(rhs = ...)``, ``lhs`` is now defined only if ``rhs`` is needed.
86  (`#74771 <https://github.com/llvm/llvm-project/issues/74771>`_)
87  (`#87530 <https://github.com/llvm/llvm-project/pull/87530>`_)
88* ``OUTPUT_FORMAT(binary)`` is now supported.
89  (`#98837 <https://github.com/llvm/llvm-project/pull/98837>`_)
90* ``NOCROSSREFS`` and ``NOCRFOSSREFS_TO`` commands now supported to prohibit
91  cross references between certain output sections.
92  (`#98773 <https://github.com/llvm/llvm-project/pull/98773>`_)
93* Orphan placement is refined to prefer the last similar section when its rank <= orphan's rank.
94  (`#94099 <https://github.com/llvm/llvm-project/pull/94099>`_)
95  Non-alloc orphan sections are now placed at the end.
96  (`#94519 <https://github.com/llvm/llvm-project/pull/94519>`_)
97* ``R_X86_64_REX_GOTPCRELX`` of the addq form is no longer incorrectly optimized when the address is larger than 0x80000000.
98
99Breaking changes
100----------------
101
102COFF Improvements
103-----------------
104
105MinGW Improvements
106------------------
107
108MachO Improvements
109------------------
110
111* Chained fixups are now enabled by default when targeting macOS 13.0,
112  iOS 13.4, tvOS 14.0, watchOS 7.0, and visionOS 1.0 or later.
113  They can be disabled with the `-no_fixup_chains` flag.
114  (`#99255 <https://github.com/llvm/llvm-project/pull/99255>`_)
115
116WebAssembly Improvements
117------------------------
118
119Fixes
120#####
121