Commit Graph

81 Commits

Author SHA1 Message Date
Peter Collingbourne 4f9527065c ELF: New symbol table design.
This patch implements a new design for the symbol table that stores
SymbolBodies within a memory region of the Symbol object. Symbols are mutated
by constructing SymbolBodies in place over existing SymbolBodies, rather
than by mutating pointers. As mentioned in the initial proposal [1], this
memory layout helps reduce the cache miss rate by improving memory locality.

Performance numbers:

           old(s) new(s)
Without debug info:
chrome      7.178  6.432 (-11.5%)
LLVMgold.so 0.505  0.502 (-0.5%)
clang       0.954  0.827 (-15.4%)
llvm-as     0.052  0.045 (-15.5%)
With debug info:
scylla      5.695  5.613 (-1.5%)
clang      14.396 14.143 (-1.8%)

Performance counter results show that the fewer required indirections is
indeed the cause of the improved performance. For example, when linking
chrome, stalled cycles decreases from 14,556,444,002 to 12,959,238,310, and
instructions per cycle increases from 0.78 to 0.83. We are also executing
many fewer instructions (15,516,401,933 down to 15,002,434,310), probably
because we spend less time allocating SymbolBodies.

The new mechanism by which symbols are added to the symbol table is by calling
add* functions on the SymbolTable.

In this patch, I handle local symbols by storing them inside "unparented"
SymbolBodies. This is suboptimal, but if we do want to try to avoid allocating
these SymbolBodies, we can probably do that separately.

I also removed a few members from the SymbolBody class that were only being
used to pass information from the input file to the symbol table.

This patch implements the new design for the ELF linker only. I intend to
prepare a similar patch for the COFF linker.

[1] http://lists.llvm.org/pipermail/llvm-dev/2016-April/098832.html

Differential Revision: http://reviews.llvm.org/D19752

llvm-svn: 268178
2016-05-01 04:55:03 +00:00
Simon Atanasyan b5c0025d1d Remove links to deleted TODOs.
llvm-svn: 266528
2016-04-16 11:11:56 +00:00
Paul Robinson a8305830db Docs: keep copyright years up-to-date.
llvm-svn: 264942
2016-03-30 22:25:04 +00:00
Rui Ueyama 7a32d9a653 We do not use libLTO, so fix the error.
llvm-svn: 264093
2016-03-22 20:58:15 +00:00
Rui Ueyama 27a3f01deb ELF: Update the document.
llvm-svn: 263473
2016-03-14 19:53:52 +00:00
Rui Ueyama 88daab9174 ELF: Add a few numbers to the document.
llvm-svn: 263466
2016-03-14 18:43:01 +00:00
Rui Ueyama 02aa766897 Update the documents of the new LLD.
This patch merges the documents for ELF and COFF into one
and puts it into docs directory.

llvm-svn: 263336
2016-03-12 06:06:40 +00:00
Rafael Espindola fd14979812 Delete more ELF bits from the old linker.
llvm-svn: 262181
2016-02-28 16:03:37 +00:00
Rafael Espindola 79944f20ea Start adding release notes for lld.
llvm-svn: 260960
2016-02-16 13:12:55 +00:00
Hans Wennborg c89f805ca6 getting_started.rst: fix 'unknown target name' error
llvm-svn: 258953
2016-01-27 17:54:35 +00:00
Rui Ueyama df06d203e5 Update documents.
llvm-svn: 253728
2015-11-20 22:47:42 +00:00
Rui Ueyama 905c41b00d Update "Getting Started" document.
llvm-svn: 253522
2015-11-18 23:53:19 +00:00
Rui Ueyama 406c7d9540 COFF: Update windows_support.html.
llvm-svn: 246786
2015-09-03 17:01:18 +00:00
Rui Ueyama 08d9520f89 Fix docs-lld-html build.
llvm-svn: 234644
2015-04-10 21:37:42 +00:00
Rui Ueyama aa7b304ea7 Remove the Native file format.
The Native file format was designed to be the fastest on-memory or
on-disk file format for object files. The problem is that no one
is working on that. No LLVM tools can produce object files in
the Native, thus the feature of supporting the format is useless
in the linker.

This patch removes the Native file support. We can add it back
if we really want it in future.

llvm-svn: 234641
2015-04-10 21:23:51 +00:00
Rui Ueyama adafac6549 Update design.rst to remove a mention about round-trip tests.
llvm-svn: 234534
2015-04-09 20:43:38 +00:00
Rui Ueyama 24f2d2a9d5 Remove Makefiles.
Most developers prefer to not have them, and we agreed to
remove them from LLD.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html

llvm-svn: 233313
2015-03-26 20:09:47 +00:00
Greg Fitzgerald 4b6a7e355b Fix five of the shared library build targets
Before this patch there was a cyclic dependency between lldCore and
lldReaderWriter.  Only lldConfig could be built as a shared library.

* Moved Reader and Writer base classes into lldCore.
* The following shared libraries can now be built:
     lldCore
     lldYAML
     lldNative
     lldPasses
     lldReaderWriter

Differential Revision: http://reviews.llvm.org/D7105

From: Greg Fitzgerald <garious@gmail.com>
llvm-svn: 226732
2015-01-21 22:54:56 +00:00
Greg Fitzgerald 8a1887f1f1 [ELF] Minimal implementation for ARM static linking
The code is able to statically link the simplest case of:

  int main() { return 0; }

* Only works with ARM code - no Thumb code, no interwork (-marm -mno-thumb-interwork)
* musl libc built with no interwork and no Thumb code

Differential Revision: http://reviews.llvm.org/D6716

From: Denis Protivensky <dprotivensky@accesssoftek.com>
llvm-svn: 226643
2015-01-21 07:35:48 +00:00
Rui Ueyama df230b21e3 Re-commit r225674: Convert other drivers to use WrapperNode.
The original commit had an issue with Mac OS dylib files. It didn't
handle fat binary dylib files correctly. This patch includes a fix.
A test for that case has already been committed in r225764.

llvm-svn: 226123
2015-01-15 04:34:31 +00:00
Rui Ueyama cfb2534ef8 Revert "Convert other drivers to use WrapperNode" and subsequent commits.
r225764 broke a basic functionality on Mac OS. This change reverts
r225764, r225766, r225767, r225769, r225814, r225816, r225829, and r225832.

llvm-svn: 225859
2015-01-14 00:21:34 +00:00
Rui Ueyama e8ecb2b144 Convert other drivers to use WrapperNode.
llvm-svn: 225764
2015-01-13 04:33:07 +00:00
Nico Weber 9b839f8ced Tweak lld's checkout instructions.
llvm-svn: 224778
2014-12-23 18:52:41 +00:00
Ed Maste aaa317a1eb lld self-hosts on FreeBSD too
llvm-svn: 224448
2014-12-17 19:14:57 +00:00
Simon Atanasyan e747a44fe8 Update current LLD status for MIPS target.
llvm-svn: 217372
2014-09-08 14:56:20 +00:00
Chad Rosier 69e2881070 [AArch64] Initial ELF/AArch64 Support
This patch adds the initial ELF/AArch64 support to lld. Only a basic "Hello
World" app has been successfully tested for both dynamic and static compiling.

Differential Revision: http://reviews.llvm.org/D4778
Patch by Daniel Stewart <stewartd@codeaurora.org>!

llvm-svn: 215544
2014-08-13 13:16:38 +00:00
Dan Liew 7f1a97bda0 Fix missing favicon.ico warning (Sphinx 1.2.2). The comments next to
``html_favicon`` seem to conflict with [what it in the sphinx
docs](http://sphinx-doc.org/config.html#confval-html_favicon).

So I've copied the comments from there to conf.py and changed its
value appropriately to remove the missing favicon.ico warning.

llvm-svn: 214971
2014-08-06 14:37:00 +00:00
Dan Liew ce5377afa0 Fix sphinx warning.
llvm-svn: 214968
2014-08-06 14:11:47 +00:00
Rui Ueyama 9aee050a0c Remove group-parent references.
Previously section groups are doubly linked to their children.
That is, an atom representing a group has group-child references
to its group contents, and content atoms also have group-parent
references to the group atom. That relationship was invariant;
if X has a group-child edge to Y, Y must have a group-parent
edge to X.

However we were not using group-parent references at all. The
resolver only needs group-child edges.

This patch simplifies the section group by removing the unused
reverse edge. No functionality change intended.

Differential Revision: http://reviews.llvm.org/D3945

llvm-svn: 210066
2014-06-03 03:07:49 +00:00
Reid Kleckner f00daf15f0 Add support for building Sphinx documentation when being built inside LLVM source tree and using CMake.
Patch by Dan Liew <daniel.liew@imperial.ac.uk>!

llvm-svn: 206662
2014-04-18 21:59:05 +00:00
Shankar Easwaran 7ac2a3df64 [core] add SectionGroup support
Review : http://llvm-reviews.chandlerc.com/D3182

llvm-svn: 204830
2014-03-26 16:37:13 +00:00
Rui Ueyama 6ab29444b0 [docs][Windows] Document how to build using Ninja.
llvm-svn: 203756
2014-03-13 05:48:46 +00:00
Rui Ueyama 21f97ddb58 [docs] Document how to build LLD as a win64 app.
llvm-svn: 203736
2014-03-12 23:40:18 +00:00
Rui Ueyama dcd25e31a7 [docs] Add a note on how to build LLD on Windows.
llvm-svn: 203613
2014-03-11 22:40:43 +00:00
Michael J. Spencer e1de2a39df [docs] Add list of missing GNU ld command line options.
llvm-svn: 203491
2014-03-10 21:25:43 +00:00
Michael J. Spencer 95a90099fa [docs] Add missing features for the x86-64 ELF backend.
llvm-svn: 203313
2014-03-07 23:54:27 +00:00
Michael J. Spencer 1dd276672f [docs] Update current status.
llvm-svn: 203188
2014-03-07 01:42:19 +00:00
Rui Ueyama 3e37326166 Add a document about Windows support.
llvm-svn: 203017
2014-03-05 22:35:32 +00:00
Rui Ueyama b63570ecb6 Fix broken link.
llvm-svn: 203004
2014-03-05 20:39:57 +00:00
Rui Ueyama 746c915c9d Visual Studio 11 = VS2012
llvm-svn: 203003
2014-03-05 20:36:07 +00:00
Chandler Carruth d40922989a Fix a typo spotted by Anton.
llvm-svn: 202638
2014-03-02 13:00:23 +00:00
Chandler Carruth 03b4e3a8cb [C++11] Update LLD documentation to just refer to the LLVM documentation
for C++11 issues.

llvm-svn: 202623
2014-03-02 09:17:09 +00:00
Shankar Easwaran 3d8de47f76 Fix trailing whitespace.
llvm-svn: 200182
2014-01-27 03:09:26 +00:00
NAKAMURA Takumi d40d387fb1 Update the copyright credits -- Happy new year 2014!
FIXME: Dragonegg may be updated at non-trivial changes.
llvm-svn: 198274
2014-01-01 08:27:31 +00:00
Rui Ueyama e68abc630e Update supported compiler list. Patch by Mikael Lyngvig!
llvm-svn: 196055
2013-12-02 01:22:17 +00:00
Joerg Sonnenberger a82566b86e Update documentation.
llvm-svn: 190255
2013-09-07 18:01:39 +00:00
Rui Ueyama 352e7308c0 Rename ti -> ctx.
This should have been done in r187823 when I renamed LinkingContext
from TargetInfo. I missed a few files.

llvm-svn: 189298
2013-08-27 00:04:42 +00:00
Rui Ueyama 0ca149fce9 Rename TargetInfo -> LinkingContext.
Also change some local variable names: "ti" -> "context" and
"_targetInfo" -> "_context".

Differential Revision: http://llvm-reviews.chandlerc.com/D1301

llvm-svn: 187823
2013-08-06 22:31:59 +00:00
Rui Ueyama 0227be6b0e [lld] Fix typo in document.
llvm-svn: 181652
2013-05-11 00:26:26 +00:00
Rui Ueyama eaadec3a39 [lld] Document about how to enable debug output.
llvm-svn: 181640
2013-05-10 22:19:28 +00:00