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