]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - docs/ReleaseNotes.rst
Vendor import of lld release_40 branch r296202:
[FreeBSD/FreeBSD.git] / docs / ReleaseNotes.rst
1 =======================
2 LLD 4.0.0 Release Notes
3 =======================
4
5 .. contents::
6     :local:
7
8 Introduction
9 ============
10
11 LLD is a linker which supports ELF (Unix), COFF (Windows) and Mach-O
12 (macOS). It is generally faster than the GNU BFD/gold linkers or the
13 MSVC linker.
14
15 LLD is designed to be a drop-in replacement for the system linkers, so
16 that users don't need to change their build systems other than swapping
17 the linker command.
18
19 This document contains the release notes for LLD 4.0.0.
20 Here we describe the status of LLD, including major improvements
21 from the previous release. All LLD releases may be downloaded
22 from the `LLVM releases web site <http://llvm.org/releases/>`_.
23
24
25 What's New in LLD 4.0?
26 ======================
27
28 ELF Improvements
29 ----------------
30
31 LLD provides much better compatibility with the GNU linker than before.
32 Now it is able to link the entire FreeBSD base system including the kernel
33 out of the box. We are working closely with the FreeBSD project to
34 make it usable as the system linker in a future release of the operating
35 system.
36
37 Multi-threading performance has been improved, and multi-threading
38 is now enabled by default. Combined with other optimizations, LLD 4.0
39 is about 1.5 times faster than LLD 3.9 when linking large programs
40 in our test environment.
41
42 Other notable changes are listed below:
43
44 * Error messages contain more information than before. If debug info
45   is available, the linker prints out not only the object file name
46   but the source location of unresolved symbols.
47
48 * Error messages are printed in red just like Clang by default. You
49   can disable it by passing ``-no-color-diagnostics``.
50
51 * LLD's version string is now embedded in a .comment section in the
52   result output file. You can dump it with this command: ``objdump -j -s
53   .comment <file>``.
54
55 * The ``-Map`` option is supported. With that, you can print out section
56   and symbol information to a specified file. This feature is useful
57   for analyzing link results.
58
59 * The file format for the ``-reproduce`` option has changed from cpio to
60   tar.
61
62 * When creating a copy relocation for a symbol, LLD now scans the
63   DSO's header to see if the symbol is in a read-only segment. If so,
64   space for the copy relocation is reserved in .bss.rel.ro instead of
65   .bss. This fixes a security issue that read-only data in a DSO
66   becomes writable if it is copied by a copy relocation. This issue
67   was disclosed originally on the
68   `binutils mailing list <https://sourceware.org/ml/libc-alpha/2016-12/msg00914.html>`_.
69
70 * Compressed input sections are supported.
71
72 * ``--oformat binary``, ``--section-start``, ``-Tbss``, ``-Tdata``,
73   ``-Ttext``, ``-b binary``, ``-build-id=uuid``, ``-no-rosegment``,
74   ``-nopie``, ``-nostdlib``, ``-omagic``, ``-retain-symbols-file``,
75   ``-sort-section``, ``-z max-page-size`` and ``-z wxneeded`` are
76   supported.
77
78 * A lot of linker script directives have been added.
79
80 * Default image base address for x86-64 has changed from 0x10000 to
81   0x200000 to make it huge-page friendly.
82
83 * ARM port now supports GNU ifunc, the ARM C++ exceptions ABI, TLS
84   relocations and static linking. Problems with ``dlopen()`` on systems
85   using eglibc fixed.
86
87 * MIPS port now supports input files in new R6 revision of MIPS ABIs
88   or N32 ABI. Generated file now contains .MIPS.abiflags section and
89   complete set of ELF headers flags.
90
91 * Relocations produced by the ``-mxgot`` compiler flag is supported
92   for MIPS. Now it is possible to generate "large" GOT that exceeds the 64K
93   limit.
94
95 COFF Improvements
96 -----------------
97
98 * Performance on Windows has been improved by parallelizing parts of the
99   linker and optimizing file system operations. As a result of these
100   improvements, LLD 4.0 has been measured to be about 2.5 times faster
101   than LLD 3.9 when linking a large Chromium DLL.