Commit Graph

12 Commits

Author SHA1 Message Date
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
Rui Ueyama df06d203e5 Update documents.
llvm-svn: 253728
2015-11-20 22:47:42 +00:00
Rui Ueyama bc9891f01d COFF: Update README.
It's no longer "new" because the old COFF linker has been removed.
Update the introduction accordingly.

llvm-svn: 244565
2015-08-11 03:44:51 +00:00
Rui Ueyama 635e85a647 COFF: Update README to mention that it now supports 32-bit x86.
The linker is now able to link not only LLVM/Clang/LLD for x86 but
even larger programs. I confirmed that it successsfully linked Chrome
for x86. Because the browser is a pretty large program, I think I can
say that the linker is now mostly feature complete. (I'm pretty sure
that there are hidden bugs somewhere, but they shouldn't be significant.)

llvm-svn: 243377
2015-07-28 03:40:58 +00:00
Rui Ueyama 5740abd7d3 COFF: Fix README.
llvm-svn: 240802
2015-06-26 17:59:12 +00:00
Rui Ueyama 3afe908294 COFF: Update README with the latest performance numbers.
llvm-svn: 240759
2015-06-26 04:26:02 +00:00
Rui Ueyama 6200b6d593 COFF: Update README.
llvm-svn: 239734
2015-06-15 16:25:11 +00:00
Rui Ueyama 095409e9e8 COFF: Add a brief description about LTO.
llvm-svn: 239714
2015-06-15 02:46:18 +00:00
Rui Ueyama 588e832d0a COFF: Support base relocations.
PE/COFF executables/DLLs usually contain data which is called
base relocations. Base relocations are a list of addresses that
need to be fixed by the loader if load-time relocation is needed.

Base relocations are in .reloc section.

We emit one base relocation entry for each IMAGE_REL_AMD64_ADDR64
relocation.

In order to save disk space, base relocations are grouped by page.
Each group is called a block. A block starts with a 32-bit page
address followed by 16-bit offsets in the page. That is more
efficient representation of addresses than just an array of 32-bit
addresses.

llvm-svn: 239710
2015-06-15 01:23:58 +00:00
Rui Ueyama 0c35b38fd2 COFF: Add a glossary to README.
llvm-svn: 239268
2015-06-07 22:42:52 +00:00
Rui Ueyama 652052b82c COFF: Update README.
Avoid saying this is based on sections because it's not very accurate.
That we don't split section into smaller chunks of data does not mean
that the linker is built on top of that.
In reality, most part of the code do not care about underlying data,
so they are neither based on "atoms" nor sections.
The symbol table only cares about symbol names and their types.
The writer handles list of chunks, which look like just blobs,
and the writer doesn't care what those chunks are backed by.
The only thing that interact with sections is SectionChunk, which is
abstracted away as one type of Chunk.

llvm-svn: 238902
2015-06-03 05:39:13 +00:00
Rui Ueyama 411c636081 COFF: Add a new PE/COFF port.
This is an initial patch for a section-based COFF linker.

The patch has 2300 lines of code including comments and blank lines.
Before diving into details, you want to start from reading README
because it should give you an overview of the design.

All important things are written in the README file, so I write
summary here.

- The linker is already able to self-link on Windows.

- It's significantly faster than the existing implementation.
  The existing one takes 5 seconds to link LLD on my machine,
  while the new one only takes 1.2 seconds, even though the new
  one is not multi-threaded yet. (And a proof-of-concept multi-
  threaded version was able to link it in 0.5 seconds.)

- It uses much less memory (250MB vs. 2GB virtual memory space
  to self-host).

- IMHO the new code is much simpler and easier to read than
  the existing PE/COFF port.

http://reviews.llvm.org/D10036

llvm-svn: 238458
2015-05-28 19:09:30 +00:00