llvm-capstone/lld
Sam Clegg 668447677a [WebAssembly] Add a flag to control merging data segments
Merging data segments produces smaller code sizes because each segment
has some boilerplate. Therefore, merging data segments is generally the
right approach, especially with wasm where binaries are typically
delivered over the network.

However, when analyzing wasm binaries, it can be helpful to get a
conservative picture of which functions are using which data
segments[0]. Perhaps there is a large data segment that you didn't
expect to be included in the wasm, introduced by some library you're
using, and you'd like to know which library it was. In this scenario,
merging data segments only makes the analysis worse.

Alternatively, perhaps you will remove some dead functions by-hand[1]
that can't be statically proven dead by the compiler or lld, and
removing these functions might make some data garbage collect-able, and
you'd like to run `--gc-sections` again so that this now-unused data can
be collected. If the segments were originally merged, then a single use
of the merged data segment will entrench all of the data.

[0] https://github.com/rustwasm/twiggy
[1] https://github.com/fitzgen/wasm-snip

Patch by Nick Fitzgerald!

Differential Revision: https://reviews.llvm.org/D46417

llvm-svn: 332013
2018-05-10 18:23:51 +00:00
..
cmake/modules [CMake] Properly conditionalize installation of lld libraries 2018-03-09 13:09:36 +00:00
COFF lld-link: Add --color-diagnostics(={always,never,auto})?, --no-color-diagnostics flags. 2018-05-10 18:19:02 +00:00
Common Rename to match an LLVM change 2018-04-11 18:49:41 +00:00
docs [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
ELF lld-link: Add --color-diagnostics(={always,never,auto})?, --no-color-diagnostics flags. 2018-05-10 18:19:02 +00:00
include/lld Migrate from std::pointer_to_unary_function as it is removed in C++17 2018-04-28 00:12:02 +00:00
lib Fix build broken by llvm r327486 2018-03-14 09:57:52 +00:00
MinGW [MinGW] Add support for the GNU ld flag --kill-at 2018-03-14 20:17:24 +00:00
test [WebAssembly] Add a flag to control merging data segments 2018-05-10 18:23:51 +00:00
tools/lld Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
unittests [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
utils Add a script to run various benchmarks and send the result to lnt. 2017-11-14 16:40:30 +00:00
wasm [WebAssembly] Add a flag to control merging data segments 2018-05-10 18:23:51 +00:00
.arcconfig [lld] Set up .arcconfig to point to new Diffusion LLD repository 2017-12-06 20:56:23 +00:00
.clang-format
.gitignore
CMakeLists.txt [WebAssembly] Initial wasm linker implementation 2017-11-17 18:14:09 +00:00
CODE_OWNERS.TXT [WebAssembly] Initial wasm linker implementation 2017-11-17 18:14:09 +00:00
LICENSE.TXT
README.md Note that the test .tar.xz has been updated. 2017-12-22 19:37:32 +00:00

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.

Benchmarking

In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.

It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz

The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f.