xref: /freebsd/contrib/llvm-project/lld/docs/ReleaseNotes.rst (revision 8c27c5541e95164a37ac1beb7bd4ef43429aed55)
185868e8aSDimitry Andric========================
285868e8aSDimitry Andriclld 10.0.0 Release Notes
385868e8aSDimitry Andric========================
40b57cec5SDimitry Andric
50b57cec5SDimitry Andric.. contents::
60b57cec5SDimitry Andric    :local:
70b57cec5SDimitry Andric
885868e8aSDimitry Andric
90b57cec5SDimitry AndricIntroduction
100b57cec5SDimitry Andric============
110b57cec5SDimitry Andric
1285868e8aSDimitry AndricThis document contains the release notes for the lld linker, release 10.0.0.
1385868e8aSDimitry AndricHere we describe the status of lld, including major improvements
1485868e8aSDimitry Andricfrom the previous release. All lld releases may be downloaded
1585868e8aSDimitry Andricfrom the `LLVM releases web site <https://llvm.org/releases/>`_.
160b57cec5SDimitry Andric
170b57cec5SDimitry AndricNon-comprehensive list of changes in this release
180b57cec5SDimitry Andric=================================================
190b57cec5SDimitry Andric
200b57cec5SDimitry AndricELF Improvements
210b57cec5SDimitry Andric----------------
220b57cec5SDimitry Andric
2385868e8aSDimitry Andric* Glob pattern, which you can use in linker scripts or version scripts,
2485868e8aSDimitry Andric  now supports `\` and `[!...]`. Except character classes
2585868e8aSDimitry Andric  (e.g. `[[:digit:]]`), lld's glob pattern should be fully compatible
2685868e8aSDimitry Andric  with GNU now. (`r375051
2785868e8aSDimitry Andric  <https://github.com/llvm/llvm-project/commit/48993d5ab9413f0e5b94dfa292a233ce55b09e3e>`_)
280b57cec5SDimitry Andric
2913138422SDimitry Andric* New ``elf32btsmipn32_fbsd`` and ``elf32ltsmipn32_fbsd`` emulations
3013138422SDimitry Andric  are supported.
3113138422SDimitry Andric
3213138422SDimitry Andric* Relax MIPS ``jalr`` and ``jr`` instructions marked by the ``R_MIPS_JALR``
3313138422SDimitry Andric  relocation.
34*8c27c554SDimitry Andric* For certain "undefined symbol" errors, a definition with a close spelling will be suggested.
35*8c27c554SDimitry Andric  (`D67039 <https://reviews.llvm.org/D67039>`_)
36*8c27c554SDimitry Andric* ``extern "C"`` is suggested if an undefined reference is mangled(unmangled) while there
37*8c27c554SDimitry Andric  is a likely unmangled(mangled) definition.
38*8c27c554SDimitry Andric  (`D69592 <https://reviews.llvm.org/D69592>`_ `D69650 <https://reviews.llvm.org/D69650>`_)
39*8c27c554SDimitry Andric* New ``-z noseparate-code``, ``-z separate-code`` and ``-z separate-loadable-segments``.
40*8c27c554SDimitry Andric  ``-z noseparate-code`` is the default, which can reduce sizes of linked binaries by up to
41*8c27c554SDimitry Andric  3 times maxpagesize.
42*8c27c554SDimitry Andric  (`D64903 <https://reviews.llvm.org/D64903>`_ `D67481 <https://reviews.llvm.org/D67481>`_)
43*8c27c554SDimitry Andric* ``-z force-bti`` and ``-z pac-plt`` are added for AArch64 Branch Target Identification and Pointer Authentication.
44*8c27c554SDimitry Andric  (`D62609 <https://reviews.llvm.org/D62609>`_)
45*8c27c554SDimitry Andric* ``--fix-cortex-a8`` is added to fix erratum 657417.
46*8c27c554SDimitry Andric  (`D67284 <https://reviews.llvm.org/D67284>`_)
47*8c27c554SDimitry Andric* ``-z force-ibt`` and ``-z shstk`` are added for Intel Control-flow Enforcement Technology.
48*8c27c554SDimitry Andric  (`D59780 <https://reviews.llvm.org/D59780>`_)
49*8c27c554SDimitry Andric* ``PT_GNU_PROPERTY`` is added to help loaders locate the ``.note.gnu.property`` section.
50*8c27c554SDimitry Andric  It may be used by a future Linux kernel.
51*8c27c554SDimitry Andric  (`D70961 <https://reviews.llvm.org/D70961>`_)
52*8c27c554SDimitry Andric* For ``--compress-debug-sections=zlib``, ``-O0`` and ``-O1`` enable compression level 1
53*8c27c554SDimitry Andric  while ``-O2`` enables compression level 6. ``-O1`` (default) is faster than before.
54*8c27c554SDimitry Andric  (`D70658 <https://reviews.llvm.org/D70658>`_)
55*8c27c554SDimitry Andric* Range extension thunks with addends are implemented for AArch64, PowerPC32 and PowerPC64.
56*8c27c554SDimitry Andric  (`D70637 <https://reviews.llvm.org/D70637>`_ `D70937 <https://reviews.llvm.org/D70937>`_
57*8c27c554SDimitry Andric  `D73424 <https://reviews.llvm.org/D73424>`_)
58*8c27c554SDimitry Andric* ``R_RISCV_ALIGN`` will be errored because linker relaxation for RISC-V is not supported.
59*8c27c554SDimitry Andric  Pass ``-mno-relax`` to disable ``R_RISCV_ALIGN``.
60*8c27c554SDimitry Andric  (`D71820 <https://reviews.llvm.org/D71820>`_)
61*8c27c554SDimitry Andric* The ARM port will no longer insert interworking thunks for non STT_FUNC symbols.
62*8c27c554SDimitry Andric  (`D73474 <https://reviews.llvm.org/D73474>`_)
63*8c27c554SDimitry Andric* The quality of PowerPC32 port has been greatly improved (canonical PLT, copy
64*8c27c554SDimitry Andric  relocations, non-preemptible IFUNC, range extension thunks with addends).
65*8c27c554SDimitry Andric  It can link FreeBSD 13.0 userland.
66*8c27c554SDimitry Andric* The PowerPC64 port supports non-preemptible IFUNC.
67*8c27c554SDimitry Andric  (`D71509 <https://reviews.llvm.org/D71509>`_)
68*8c27c554SDimitry Andric* lld creates a RO PT_LOAD and a RX PT_LOAD without a linker script.
69*8c27c554SDimitry Andric  lld creates a unified RX PT_LOAD with a linker script.
70*8c27c554SDimitry Andric  A future release will eliminate this difference and use a RO PT_LOAD and a RX PT_LOAD by default.
71*8c27c554SDimitry Andric  The linker script case will require ``--no-rosegment`` to restore the current behavior.
72*8c27c554SDimitry Andric* GNU style compressed debug sections ``.zdebug`` (obsoleted by ``SHF_COMPRESSED``)
73*8c27c554SDimitry Andric  are supported for input files, but not for the output.
74*8c27c554SDimitry Andric  A future release may drop ``.zdebug`` support.
7513138422SDimitry Andric
76*8c27c554SDimitry AndricBreaking changes
77*8c27c554SDimitry Andric----------------
7813138422SDimitry Andric
79*8c27c554SDimitry Andric* ``-Ttext=$base`` (base is usually 0) is no longer supported.
80*8c27c554SDimitry Andric  If PT_PHDR is needed, use ``--image-base=$base`` instead.
81*8c27c554SDimitry Andric  If PT_PHDR is not needed, use a linker script with `.text 0 : { *(.text*) }` as the first
82*8c27c554SDimitry Andric  output section description.
83*8c27c554SDimitry Andric  See https://bugs.llvm.org/show_bug.cgi?id=44715 for more information.
84*8c27c554SDimitry Andric  (`D67325 <https://reviews.llvm.org/D67325>`_)
85*8c27c554SDimitry Andric* ``-Ttext-segment`` is no longer supported. Its meaning was different from GNU ld's and
86*8c27c554SDimitry Andric  could cause subtle bugs.
87*8c27c554SDimitry Andric  (`D70468 <https://reviews.llvm.org/D70468>`_)
880b57cec5SDimitry Andric
890b57cec5SDimitry Andric
900b57cec5SDimitry AndricMinGW Improvements
910b57cec5SDimitry Andric------------------
920b57cec5SDimitry Andric
9313138422SDimitry Andric* Allow using custom .edata sections from input object files (for use
9413138422SDimitry Andric  by Wine)
95*8c27c554SDimitry Andric  (`dadc6f248868 <https://reviews.llvm.org/rGdadc6f248868>`_)
9613138422SDimitry Andric
9713138422SDimitry Andric* Don't implicitly create import libraries unless requested
98*8c27c554SDimitry Andric  (`6540e55067e3 <https://reviews.llvm.org/rG6540e55067e3>`_)
9913138422SDimitry Andric
10013138422SDimitry Andric* Support merging multiple resource object files
101*8c27c554SDimitry Andric  (`3d3a9b3b413d <https://reviews.llvm.org/rG3d3a9b3b413d>`_)
10213138422SDimitry Andric  and properly handle the default manifest object files that GCC can pass
103*8c27c554SDimitry Andric  (`d581dd501381 <https://reviews.llvm.org/rGd581dd501381>`_)
10413138422SDimitry Andric
10513138422SDimitry Andric* Demangle itanium symbol names in warnings/error messages
106*8c27c554SDimitry Andric  (`a66fc1c99f3e <https://reviews.llvm.org/rGa66fc1c99f3e>`_)
10713138422SDimitry Andric
10813138422SDimitry Andric* Print source locations for undefined references and duplicate symbols,
10913138422SDimitry Andric  if possible
110*8c27c554SDimitry Andric  (`1d06d48bb346 <https://reviews.llvm.org/rG1d06d48bb346>`_)
11113138422SDimitry Andric  and
112*8c27c554SDimitry Andric  (`b38f577c015c <https://reviews.llvm.org/rGb38f577c015c>`_)
11313138422SDimitry Andric
11413138422SDimitry Andric* Look for more filename patterns when resolving ``-l`` options
115*8c27c554SDimitry Andric  (`0226c35262df <https://reviews.llvm.org/rG0226c35262df>`_)
11613138422SDimitry Andric
11713138422SDimitry Andric* Don't error out on duplicate absolute symbols with the same value
11813138422SDimitry Andric  (which can happen for the default-null symbol for weak symbols)
119*8c27c554SDimitry Andric  (`1737cc750c46 <https://reviews.llvm.org/rG1737cc750c46>`_)
1200b57cec5SDimitry Andric
1210b57cec5SDimitry Andric
12285868e8aSDimitry AndricWebAssembly Improvements
12385868e8aSDimitry Andric------------------------
1240b57cec5SDimitry Andric
12585868e8aSDimitry Andric* `__data_end` and `__heap_base` are no longer exported by default,
12685868e8aSDimitry Andric  as it's best to keep them internal when possible. They can be
12785868e8aSDimitry Andric  explicitly exported with `--export=__data_end` and
12885868e8aSDimitry Andric  `--export=__heap_base`, respectively.
12947395794SDimitry Andric* wasm-ld now elides .bss sections when the memory is not imported
130