summaryrefslogtreecommitdiff
path: root/docs/ReleaseNotes.rst
blob: 01a984148b7e82af6fbe48fb3dbc041803a2214f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
=======================
lld 5.0.0 Release Notes
=======================

.. contents::
    :local:

Introduction
============

lld is a linker from the LLVM project. It supports ELF (Unix), COFF (Windows)
and Mach-O (macOS), and it is generally faster than the GNU bfd or gold linkers
or the MSVC linker.

lld is designed to be a drop-in replacement for the system linkers, so that
users don't need to change their build systems other than swapping the linker
command.

All lld releases may be downloaded from the `LLVM releases web site
<http://llvm.org/releases/>`_.

Non-comprehensive list of changes in this release
=================================================

ELF Improvements
----------------

* First and foremost, a lot of compatibility issues and bugs have been fixed.
  Linker script support has significantly improved. As a result, we believe you
  are very likely to be able to link your programs with lld without experiencing
  any problem now.

* Error message format has changed in order to improve readability.
  Traditionally, linker's error messages are concise and arguably too terse.
  This is an example of lld 4.0.0's error message (they are actually in one line)::

    /ssd/clang/bin/ld.lld: error: /ssd/llvm-project/lld/ELF/Writer.cpp:207:
      undefined symbol 'lld::elf::EhFrameSection::addSection()'

  It is not easy to read because too much information is packed into a single line
  and the embedded text, particularly a symbol name, is sometimes too long.
  In lld 5.0.0, we use more vertical space to print out error messages in a more
  structured manner like this::

    bin/ld.lld: error: undefined symbol: lld::elf::EhFrameSection::addSection()
    >>> Referenced by Writer.cpp:207 (/ssd/llvm-project/lld/ELF/Writer.cpp:207)
    >>>               Writer.cpp.o in archive lib/liblldELF.a

  As a bonus, the new error message contains source code location of the error
  if it is available from debug info.

* ``./configure`` scripts generated by GNU autoconf determines whether a linker
  supports modern GNU-compatible features or not by searching for "GNU" in the
  ``--help`` message. To be compatible with the scripts, we decided to add a
  string "(compatible with GNU linkers)" to our ``--help`` message. This is a
  hack, but just like the web browser's User-Agent string (which everyone still
  claim they are "Mozilla/5.0"), we had no choice other than doing this to claim
  that we accept GNU-compatible options.

* The ``-Map`` option is added. The option is to make the linker to print out how
  input files are mapped to the output file. Here is an example::

    Address          Size             Align Out     In      Symbol
    00000000016d84d8 00000000008f8f50     8 .eh_frame
    00000000016d84d8 00000000008f8f50     8         <internal>:(.eh_frame)
    0000000001fd2000 00000000034b3bd0    16 .text
    0000000001fd2000 000000000000002a     1         /usr/lib/x86_64-linux-gnu/crt1.o:(.text)
    0000000001fd2000 0000000000000000     0                 _start
    0000000001fd202a 0000000000000000     1         /usr/lib/x86_64-linux-gnu/crti.o:(.text)
    0000000001fd2030 00000000000000bd    16         /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o:(.text)
    0000000001fd2030 0000000000000000     0                 deregister_tm_clones
    0000000001fd2060 0000000000000000     0                 register_tm_clones

  This format is not the same as GNU linkers as our linker internal data
  structure is different from them but contains the same amount of information
  and should be more readable than their outputs.

  As with other lld features, the ``-Map`` option is designed with speed in mind.
  The option would generate a hundred megabyte text file if you link a large
  program with it. lld can usually do that in a few seconds, and it is generally
  a few times faster than the GNU gold's ``-Map`` option.

* lld's ``--gdb-index`` option used to be slow, but we sped it up so that it is
  at least as fast as the GNU gold.

* Some nonstandard relocations, such as R_X86_64_8 or R_X86_64_16, are supported.
  They are not used for 32/64-bit applications, but some 16-bit bootloaders need
  them.

* Paddings in executable text sections are now filled with trap instructions
  (such as INT3) instead of being left as null bytes. This change improves
  disassembler outputs because it now prints out trap instructions instead of
  trying to decode 0x00 as an instruction. It also makes debugging of some type
  of program easier because when the control reaches a padding, the program
  immediately raises an error.

* The following options are added: ``-M``, ``-Map``,
  ``-compress-debug-sections``, ``-emit-relocs``,
  ``-error-unresolved-symbols``, ``-exclude-libs``, ``-filter``,
  ``-no-dynamic-linker``, ``-no-export-dynamic``, ``-no-fatal-warnings``,
  ``-print-map``, ``-warn-unresolved-symbols``, ``-z nocopyreloc``,
  ``-z notext``, ``-z rodynamic``


Contributors to lld 5.0
=======================

We had 63 individuals contribute to lld 5.0. Thank you so much!

- Adrian McCarthy
- Alberto Magni
- Alexander Richardson
- Andre Vieira
- Andrew Ng
- Anton Korobeynikov
- Bob Haarman
- David Blaikie
- Davide Italiano
- David L. Jones
- Dmitry Mikulin
- Ed Maste
- Ed Schouten
- Eric Beckmann
- Eric Fiselier
- Eugene Leviant
- Evgeniy Stepanov
- Galina Kistanova
- George Rimar
- Hans Wennborg
- Igor Kudrin
- Ismail Donmez
- Jake Ehrlich
- James Henderson
- Joel Jones
- Jon Chesterfield
- Kamil Rytarowski
- Kevin Enderby
- Konstantin Zhuravlyov
- Kyungwoo Lee
- Leslie Zhai
- Mark Kettenis
- Martell Malone
- Martin Storsjo
- Meador Inge
- Mehdi Amini
- Michal Gorny
- NAKAMURA Takumi
- Paul Robinson
- Pavel Labath
- Petar Jovanovic
- Peter Collingbourne
- Peter Smith
- Petr Hosek
- Rafael Espindola
- Reid Kleckner
- Richard Smith
- Robert Clarke
- Rui Ueyama
- Saleem Abdulrasool
- Sam Clegg
- Sean Eveson
- Sean Silva
- Shankar Easwaran
- Shoaib Meenai
- Simon Atanasyan
- Simon Dardis
- Simon Tatham
- Sylvestre Ledru
- Tom Stellard
- Vitaly Buka
- Yuka Takahashi
- Zachary Turner