xref: /freebsd/contrib/llvm-project/lld/docs/ReleaseNotes.rst (revision 61cfbce3347e4372143bcabf7b197577b9f3958a)
11fd87a68SDimitry Andric===========================
21fd87a68SDimitry Andriclld |release| Release Notes
31fd87a68SDimitry Andric===========================
40b57cec5SDimitry Andric
50b57cec5SDimitry Andric.. contents::
60b57cec5SDimitry Andric    :local:
70b57cec5SDimitry Andric
81fd87a68SDimitry Andric.. only:: PreRelease
91fd87a68SDimitry Andric
10e8d8bef9SDimitry Andric  .. warning::
111fd87a68SDimitry Andric     These are in-progress notes for the upcoming LLVM |release| release.
12e8d8bef9SDimitry Andric     Release notes for previous releases can be found on
13e8d8bef9SDimitry Andric     `the Download Page <https://releases.llvm.org/download.html>`_.
14e8d8bef9SDimitry Andric
150b57cec5SDimitry AndricIntroduction
160b57cec5SDimitry Andric============
170b57cec5SDimitry Andric
181fd87a68SDimitry AndricThis document contains the release notes for the lld linker, release |release|.
1985868e8aSDimitry AndricHere we describe the status of lld, including major improvements
2085868e8aSDimitry Andricfrom the previous release. All lld releases may be downloaded
2185868e8aSDimitry Andricfrom the `LLVM releases web site <https://llvm.org/releases/>`_.
220b57cec5SDimitry Andric
230b57cec5SDimitry AndricNon-comprehensive list of changes in this release
240b57cec5SDimitry Andric=================================================
250b57cec5SDimitry Andric
260b57cec5SDimitry AndricELF Improvements
270b57cec5SDimitry Andric----------------
28*61cfbce3SDimitry Andric* ``--package-metadata=`` has been added to create package metadata notes
29*61cfbce3SDimitry Andric  (`D131439 <https://reviews.llvm.org/D131439>`_)
300b57cec5SDimitry Andric
3181ad6265SDimitry Andric* ``-z pack-relative-relocs`` is now available to support ``DT_RELR`` for glibc 2.36+.
3281ad6265SDimitry Andric  (`D120701 <https://reviews.llvm.org/D120701>`_)
3381ad6265SDimitry Andric* ``--no-fortran-common`` (pre 12.0.0 behavior) is now the default.
34*61cfbce3SDimitry Andric* ``--load-pass-plugin`` has been added to load a new pass manager plugin.
35*61cfbce3SDimitry Andric  (`D120490 <https://reviews.llvm.org/D120490>`_)
36*61cfbce3SDimitry Andric* ``--android-memtag-{mode=,stack,heap}`` have been added to synthesize SHT_NOTE for memory tags on Android.
37*61cfbce3SDimitry Andric  (`D119384 <https://reviews.llvm.org/D119384>`_)
38753f127fSDimitry Andric* ``FORCE_LLD_DIAGNOSTICS_CRASH`` environment variable is now available to force LLD to crash.
39753f127fSDimitry Andric  (`D128195 <https://reviews.llvm.org/D128195>`_)
40*61cfbce3SDimitry Andric* ``--wrap`` semantics have been refined.
41*61cfbce3SDimitry Andric  (`rG7288b85cc80f1ce5509aeea860e6b4232cd3ca01 <https://reviews.llvm.org/rG7288b85cc80f1ce5509aeea860e6b4232cd3ca01>`_)
42*61cfbce3SDimitry Andric  (`D118756 <https://reviews.llvm.org/D118756>`_)
43*61cfbce3SDimitry Andric  (`D124056 <https://reviews.llvm.org/D124056>`_)
44*61cfbce3SDimitry Andric* ``--build-id={md5,sha1}`` are now implemented with truncated BLAKE3.
45*61cfbce3SDimitry Andric  (`D121531 <https://reviews.llvm.org/D121531>`_)
46*61cfbce3SDimitry Andric* ``--emit-relocs``: ``.rel[a].eh_frame`` relocation offsets are now adjusted.
47*61cfbce3SDimitry Andric  (`D122459 <https://reviews.llvm.org/D122459>`_)
48*61cfbce3SDimitry Andric* ``--emit-relocs``: fixed missing ``STT_SECTION`` when the first input section is synthetic.
49*61cfbce3SDimitry Andric  (`D122463 <https://reviews.llvm.org/D122463>`_)
50*61cfbce3SDimitry Andric* ``(TYPE=<value>)`` can now be used in linker scripts.
51*61cfbce3SDimitry Andric  (`D118840 <https://reviews.llvm.org/D118840>`_)
52*61cfbce3SDimitry Andric* Local symbol initialization is now performed in parallel.
53*61cfbce3SDimitry Andric  (`D119909 <https://reviews.llvm.org/D119909>`_)
54*61cfbce3SDimitry Andric  (`D120626 <https://reviews.llvm.org/D120626>`_)
5513138422SDimitry Andric
568c27c554SDimitry AndricBreaking changes
578c27c554SDimitry Andric----------------
5813138422SDimitry Andric
59*61cfbce3SDimitry Andric* Archives are now parsed as ``--start-lib`` object files. If a member is neither
60*61cfbce3SDimitry Andric  an ELF relocatable object file nor an LLVM bitcode file, ld.lld will give a warning.
61*61cfbce3SDimitry Andric  (`D119074 <https://reviews.llvm.org/D119074>`_)
6281ad6265SDimitry Andric* The GNU ld incompatible ``--no-define-common`` has been removed.
6381ad6265SDimitry Andric* The obscure ``-dc``/``-dp`` options have been removed.
64*61cfbce3SDimitry Andric  (`D119108 <https://reviews.llvm.org/D119108>`_)
6581ad6265SDimitry Andric* ``-d`` is now ignored.
6681ad6265SDimitry Andric* If a prevailing COMDAT group defines STB_WEAK symbol, having a STB_GLOBAL symbol in a non-prevailing group is now rejected with a diagnostic.
6781ad6265SDimitry Andric  (`D120626 <https://reviews.llvm.org/D120626>`_)
6881ad6265SDimitry Andric* Support for the legacy ``.zdebug`` format has been removed. Run
6981ad6265SDimitry Andric  ``objcopy --decompress-debug-sections`` in case old object files use ``.zdebug``.
7081ad6265SDimitry Andric  (`D126793 <https://reviews.llvm.org/D126793>`_)
7181ad6265SDimitry Andric* ``--time-trace-file=<file>`` has been removed.
7281ad6265SDimitry Andric  Use ``--time-trace=<file>`` instead.
7381ad6265SDimitry Andric  (`D128451 <https://reviews.llvm.org/D128451>`_)
740b57cec5SDimitry Andric
755ffd83dbSDimitry AndricCOFF Improvements
765ffd83dbSDimitry Andric-----------------
775ffd83dbSDimitry Andric
7881ad6265SDimitry Andric* Added autodetection of MSVC toolchain, a la clang-cl.  Also added
7981ad6265SDimitry Andric  ``/winsysroot:`` support for explicit specification of MSVC toolchain
8081ad6265SDimitry Andric  location, similar to clang-cl's ``/winsysroot``. For now,
8181ad6265SDimitry Andric  ``/winsysroot:`` requires also passing in an explicit ``/machine:`` flag.
8281ad6265SDimitry Andric  (`D118070 <https://reviews.llvm.org/D118070>`_)
8381ad6265SDimitry Andric* ...
840b57cec5SDimitry Andric
850b57cec5SDimitry AndricMinGW Improvements
860b57cec5SDimitry Andric------------------
870b57cec5SDimitry Andric
88*61cfbce3SDimitry Andric* The ``--disable-reloc-section`` option is now supported.
89*61cfbce3SDimitry Andric  (`D127478 <https://reviews.llvm.org/D127478>`_)
90*61cfbce3SDimitry Andric* The ``--exclude-symbols`` option is now supported.
91*61cfbce3SDimitry Andric  (`D130118 <https://reviews.llvm.org/D130118>`_)
92*61cfbce3SDimitry Andric
93*61cfbce3SDimitry Andric* Support for an entirely new object file directive, ``-exclude-symbols:``,
94*61cfbce3SDimitry Andric  has been implemented. (`D130120 <https://reviews.llvm.org/D130120>`_)
95e8d8bef9SDimitry Andric
9681ad6265SDimitry AndricMachO Improvements
9781ad6265SDimitry Andric------------------
98e8d8bef9SDimitry Andric
99753f127fSDimitry Andric* We now support proper relocation and pruning of EH frames. **Note:** this
100753f127fSDimitry Andric  comes at some performance overhead on x86_64 builds, and we recommend adding
101753f127fSDimitry Andric  the ``-femit-compact-unwind=no-compact-unwind`` compile flag to avoid it.
102753f127fSDimitry Andric  (`D129540 <https://reviews.llvm.org/D129540>`_,
103753f127fSDimitry Andric  `D122258 <https://reviews.llvm.org/D122258>`_)
104e8d8bef9SDimitry Andric
105*61cfbce3SDimitry AndricNew flags
106*61cfbce3SDimitry Andric#########
107*61cfbce3SDimitry Andric
108*61cfbce3SDimitry Andric* ``-load_hidden`` and ``-hidden-l`` are now supported.
109*61cfbce3SDimitry Andric  (`D130473 <https://reviews.llvm.org/D130473>`_,
110*61cfbce3SDimitry Andric  `D130529 <https://reviews.llvm.org/D130529>`_)
111*61cfbce3SDimitry Andric* ``-alias`` is now supported. (`D129938 <https://reviews.llvm.org/D129938>`_)
112*61cfbce3SDimitry Andric* ``-no_exported_symbols`` and  ``-exported_symbols_list <empty file>`` are now
113*61cfbce3SDimitry Andric  supported. (`D127562 <https://reviews.llvm.org/D127562>`_)
114*61cfbce3SDimitry Andric* ``-w`` -- to suppress warnings -- is now supported.
115*61cfbce3SDimitry Andric  (`D127564 <https://reviews.llvm.org/D127564>`_)
116*61cfbce3SDimitry Andric* ``-non_global_symbols_strip_list``, ``-non_global_symbols_no_strip_list``, and
117*61cfbce3SDimitry Andric  ``-x`` are now supported. (`D126046 <https://reviews.llvm.org/D126046>`_)
118*61cfbce3SDimitry Andric* ``--icf=safe`` is now supported.
119*61cfbce3SDimitry Andric  (`D128938 <https://reviews.llvm.org/D128938>`_,
120*61cfbce3SDimitry Andric  `D123752 <https://reviews.llvm.org/D123752>`_)
121*61cfbce3SDimitry Andric* ``-why_live`` is now supported.
122*61cfbce3SDimitry Andric  (`D120377 <https://reviews.llvm.org/D120377>`_)
123*61cfbce3SDimitry Andric* ``-pagezero_size`` is now supported.
124*61cfbce3SDimitry Andric  (`D118724 <https://reviews.llvm.org/D118724>`_)
125*61cfbce3SDimitry Andric
126*61cfbce3SDimitry AndricImprovements
127*61cfbce3SDimitry Andric############
128*61cfbce3SDimitry Andric
129*61cfbce3SDimitry Andric* Linker optimization hints are now supported.
130*61cfbce3SDimitry Andric  (`D129427 <https://reviews.llvm.org/D129427>`_,
131*61cfbce3SDimitry Andric  `D129059 <https://reviews.llvm.org/D129059>`_,
132*61cfbce3SDimitry Andric  `D128942 <https://reviews.llvm.org/D128942>`_,
133*61cfbce3SDimitry Andric  `D128093 <https://reviews.llvm.org/D128093>`_)
134*61cfbce3SDimitry Andric* Rebase opcodes are now encoded more compactly.
135*61cfbce3SDimitry Andric  (`D130180 <https://reviews.llvm.org/D130180>`_,
136*61cfbce3SDimitry Andric  `D128798 <https://reviews.llvm.org/D128798>`_)
137*61cfbce3SDimitry Andric* C-strings are now aligned more compactly.
138*61cfbce3SDimitry Andric  (`D121342 <https://reviews.llvm.org/D121342>`_)
139*61cfbce3SDimitry Andric* ``--deduplicate-literals`` (and ``--icf={safe,all}``) now fold the
140*61cfbce3SDimitry Andric  ``__cfstring`` section.
141*61cfbce3SDimitry Andric  (`D130134  <https://reviews.llvm.org/D130134>`_,
142*61cfbce3SDimitry Andric  `D120137 <https://reviews.llvm.org/D120137>`_)
143*61cfbce3SDimitry Andric* ICF now folds the ``__objc_classrefs`` section.
144*61cfbce3SDimitry Andric  (`D121053 <https://reviews.llvm.org/D121053>`_)
145*61cfbce3SDimitry Andric* ICF now folds functions with identical LSDAs.
146*61cfbce3SDimitry Andric  (`D129830 <https://reviews.llvm.org/D129830>`_)
147*61cfbce3SDimitry Andric* STABS entries for folded functions are now omitted.
148*61cfbce3SDimitry Andric  (`D123252 <https://reviews.llvm.org/D123252>`_)
149*61cfbce3SDimitry Andric* ``__objc_imageinfo`` sections are now folded.
150*61cfbce3SDimitry Andric  (`D130125 <https://reviews.llvm.org/D130125>`_)
151*61cfbce3SDimitry Andric* Dylibs with ``LC_DYLD_EXPORTS_TRIE`` can now be read.
152*61cfbce3SDimitry Andric  (`D129430 <https://reviews.llvm.org/D129430>`_)
153*61cfbce3SDimitry Andric* Writing zippered dylibs is now supported.
154*61cfbce3SDimitry Andric  (`D124887 <https://reviews.llvm.org/D124887>`_)
155*61cfbce3SDimitry Andric* C-string literals are now included in the mapfile.
156*61cfbce3SDimitry Andric  (`D118077 <https://reviews.llvm.org/D118077>`_)
157*61cfbce3SDimitry Andric* Symbol names in several more diagnostics are now demangled.
158*61cfbce3SDimitry Andric  (`D130490 <https://reviews.llvm.org/D130490>`_,
159*61cfbce3SDimitry Andric  `D127110 <https://reviews.llvm.org/D127110>`_,
160*61cfbce3SDimitry Andric  `D125732 <https://reviews.llvm.org/D125732>`_)
161*61cfbce3SDimitry Andric* Source information is now included in symbol error messages.
162*61cfbce3SDimitry Andric  (`D128425 <https://reviews.llvm.org/D128425>`_,
163*61cfbce3SDimitry Andric  `D128184 <https://reviews.llvm.org/D128184>`_)
164*61cfbce3SDimitry Andric* Numerous other improvements were made to diagnostic messages.
165*61cfbce3SDimitry Andric  (`D127753 <https://reviews.llvm.org/D127753>`_,
166*61cfbce3SDimitry Andric  `D127696 <https://reviews.llvm.org/D127696>`_,
167*61cfbce3SDimitry Andric  `D127670 <https://reviews.llvm.org/D127670>`_,
168*61cfbce3SDimitry Andric  `D118903 <https://reviews.llvm.org/D118903>`_,
169*61cfbce3SDimitry Andric  `D118798 <https://reviews.llvm.org/D118798>`_)
170*61cfbce3SDimitry Andric* Many performance and memory improvements were made.
171*61cfbce3SDimitry Andric  (`D130000 <https://reviews.llvm.org/D130000>`_,
172*61cfbce3SDimitry Andric  `D128298 <https://reviews.llvm.org/D128298>`_,
173*61cfbce3SDimitry Andric  `D128290 <https://reviews.llvm.org/D128290>`_,
174*61cfbce3SDimitry Andric  `D126800 <https://reviews.llvm.org/D126800>`_,
175*61cfbce3SDimitry Andric  `D126785 <https://reviews.llvm.org/D126785>`_,
176*61cfbce3SDimitry Andric  `D121052 <https://reviews.llvm.org/D121052>`_)
177*61cfbce3SDimitry Andric* Order files and call graph sorting can now be used together.
178*61cfbce3SDimitry Andric  (`D117354 <https://reviews.llvm.org/D117354>`_)
179*61cfbce3SDimitry Andric* Give LTO more precise symbol resolutions, which allows optimizations to be
180*61cfbce3SDimitry Andric  more effective.
181*61cfbce3SDimitry Andric  (`D119506 <https://reviews.llvm.org/D119506>`_,
182*61cfbce3SDimitry Andric  `D119372 <https://reviews.llvm.org/D119372>`_,
183*61cfbce3SDimitry Andric  `D119767 <https://reviews.llvm.org/D119767>`_)
184*61cfbce3SDimitry Andric* Added partial support for linking object files built with DTrace probes.
185*61cfbce3SDimitry Andric  (`D129062 <https://reviews.llvm.org/D129062>`_)
186*61cfbce3SDimitry Andric
187*61cfbce3SDimitry AndricFixes
188*61cfbce3SDimitry Andric#####
189*61cfbce3SDimitry Andric
190*61cfbce3SDimitry Andric* Programs using Swift linked with the 14.0 SDK but an older deployment target
191*61cfbce3SDimitry Andric  no longer crash at startup when running on older iOS versions. This is because
192*61cfbce3SDimitry Andric  we now correctly support ``$ld$previous`` symbols that contain an explicit
193*61cfbce3SDimitry Andric  symbol name. (`D130725 <https://reviews.llvm.org/D130725>`_)
194*61cfbce3SDimitry Andric* Match ld64's behavior when an archive is specified both via
195*61cfbce3SDimitry Andric  ``LC_LINKER_OPTION`` and via the command line.
196*61cfbce3SDimitry Andric  (`D129556 <https://reviews.llvm.org/D129556>`_)
197*61cfbce3SDimitry Andric* ``-ObjC`` now correctly loads archives with Swift sections.
198*61cfbce3SDimitry Andric  (`D125250 <https://reviews.llvm.org/D125250>`_)
199*61cfbce3SDimitry Andric* ``-lto_object_path`` now accepts a filename (instead of just a directory
200*61cfbce3SDimitry Andric  name.) (`D129705 <https://reviews.llvm.org/D129705>`_)
201*61cfbce3SDimitry Andric* The ``LC_UUID`` hash now includes the output file's name.
202*61cfbce3SDimitry Andric  (`D122843 <https://reviews.llvm.org/D122843>`_)
203*61cfbce3SDimitry Andric* ``-flat_namespace`` now correctly makes all extern symbols in a dylib
204*61cfbce3SDimitry Andric  interposable. (`D119294 <https://reviews.llvm.org/D119294>`_)
205*61cfbce3SDimitry Andric* Fixed compact unwind output when linking on 32-bit hosts.
206*61cfbce3SDimitry Andric  (`D129363 <https://reviews.llvm.org/D129363>`_)
207*61cfbce3SDimitry Andric* Exporting private symbols no longer triggers an assertion.
208*61cfbce3SDimitry Andric  (`D124143 <https://reviews.llvm.org/D124143>`_)
209*61cfbce3SDimitry Andric* MacOS-only ``.tbd`` files are now supported when targeting Catalyst.
210*61cfbce3SDimitry Andric  (`D124336 <https://reviews.llvm.org/D124336>`_)
211*61cfbce3SDimitry Andric* Thunk symbols now have local visibility, avoiding false duplicate symbol
212*61cfbce3SDimitry Andric  errors. (`D122624 <https://reviews.llvm.org/D122624>`_)
213*61cfbce3SDimitry Andric* Fixed handling of relocatable object files within frameworks.
214*61cfbce3SDimitry Andric  (`D114841 <https://reviews.llvm.org/D114841>`_)
215*61cfbce3SDimitry Andric
216e8d8bef9SDimitry AndricWebAssembly Improvements
217e8d8bef9SDimitry Andric------------------------
218e8d8bef9SDimitry Andric
219