| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Reviewed By: ruiu, MaskRay
Differential Revision: https://reviews.llvm.org/D72196
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
export names
This is equivalent to the existing `import_name` and `import_module`
attributes which control the import names in the final wasm binary
produced by lld.
This maps the existing
This attribute currently requires a string rather than using the
symbol name for a couple of reasons:
1. Avoid confusion with static and dynamic linking which is
based on symbol name. Exporting a function from a wasm module using
this directive is orthogonal to both static and dynamic linking.
2. Avoids name mangling.
Differential Revision: https://reviews.llvm.org/D70520
|
|
|
|
|
|
|
|
|
|
|
| |
This patch does the same thing as r365595 to other subdirectories,
which completes the naming style change for the entire lld directory.
With this, the naming style conversion is complete for lld.
Differential Revision: https://reviews.llvm.org/D64473
llvm-svn: 365730
|
|
|
|
|
|
| |
style change. NFC.
llvm-svn: 365605
|
|
|
|
|
|
|
|
|
| |
When a function is excluded via comdat we shouldn't add it to the
final list of init functions.
Differential Revision: https://reviews.llvm.org/D62983
llvm-svn: 362769
|
|
|
|
|
|
|
|
|
|
|
| |
Major refactor to better match the structure of the ELF linker.
- Split out relocation processing into scanRelocations
- Split out synthetic sections into their own classes.
Differential Revision: https://reviews.llvm.org/D61811
llvm-svn: 361233
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
Data section relocations in wasm shared libraries are applied by the
library itself at static constructor time. This change adds a new
synthetic function that applies relocations to relevant memory locations
on startup.
Differential Revision: https://reviews.llvm.org/D59278
llvm-svn: 357715
|
|
|
|
|
|
|
|
|
|
| |
See https://reviews.llvm.org/D59860
The initial version of this change effected more than just the
error message. This version is scoped down to only effect the error
itself.
llvm-svn: 357328
|
|
|
|
|
|
| |
This reverts commit 0805ec5f7b5c80474352531a99e721c30e73e77f.
llvm-svn: 357225
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also Revert "[WebAssembly] Fix typo from rL357143"
This reverts commit 0805ec5f7b5c80474352531a99e721c30e73e77f and
a9958fc30d0c6d4c140be892c5a824b827d2eb5d
(rL357143 and rL357144)
They cause failures with address-taken extern (JS) functions
in emscripten.
llvm-svn: 357224
|
|
|
|
| |
llvm-svn: 357144
|
|
|
|
|
|
|
|
| |
This message now matches the equivalent message in the ELF linker.
Differential Revision: https://reviews.llvm.org/D59860
llvm-svn: 357143
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D54758
llvm-svn: 347621
|
|
|
|
|
|
|
|
| |
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D50976
llvm-svn: 343157
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a rebased version https://reviews.llvm.org/D42176 which is patch
by Nicolas Wilson.
Addresses issue:
https://github.com/WebAssembly/tool-conventions/issues/32, and
https://bugs.llvm.org/show_bug.cgi?id=38650
Previously, for each function/segment we iterated over every relocation
to find the relevant ones, which is an n^2 operation. Now, we just make
a single pass.
Differential Revision: https://reviews.llvm.org/D51063
llvm-svn: 340428
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds the ability for lld to remove LEB padding from
code section. This effectively shrinks the size of the resulting
binary in proportion to the number of code relocations.
Since there will be a performance cost this is currently only active for
-O1 and above. Some toolchains may instead want to perform this
compression as a post linker step (for example running a binary through
binaryen will automatically compress these values).
I imagine we might want to make this the default in the future.
Differential Revision: https://reviews.llvm.org/D46416
llvm-svn: 332783
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes: lld: warning: unexpected existing value for R_WEBASSEMBLY_FUNCTION_OFFSET_I32: existing=839 expected=838
The existing solution is trying to erroneously recover correct offset of
the function code from the body (which is not a function segment that
includes its size, locals, and code).
The D46763 is trying to maintain the offset of the function code
allowing properly calculate the new relocation entry.
Patch by Yury Delendik
Differential Revision: https://reviews.llvm.org/D46765
llvm-svn: 332412
|
|
|
|
|
|
|
|
|
|
|
| |
Also:
- Reduce the error to a warning so that debug and release
versions can still link the same inputs.
- Add another check to verify the input LEB is padded to 5 bytes
Differential Revision: https://reviews.llvm.org/D46479
llvm-svn: 331571
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically add support for custom sections that contain
relocations, and for the two new relocation types needed
by DWARF sections.
See: https://reviews.llvm.org/D44184
Patch by Yury Delendik!
Differential Revision: https://reviews.llvm.org/D44184
llvm-svn: 331566
|
|
|
|
|
|
|
|
|
|
| |
Enables cleaning up confusion between which name variables are mangled
and which are unmangled, and --print-gc-sections then excersises and
tests that.
Differential Revision: https://reviews.llvm.org/D44440
llvm-svn: 330449
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The content of custome sections no longer includes the
name itself.
See: https://reviews.llvm.org/D45579
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D45580
llvm-svn: 329948
|
|
|
|
|
|
|
|
|
| |
Copy user-defined custom sections into the output, concatenating
sections with the same name.
Differential Revision: https://reviews.llvm.org/D45340
llvm-svn: 329717
|
|
|
|
|
|
|
|
|
| |
This reduces the number of lookups to one per COMDAT group, rather than
one per symbol in a COMDAT group.
Differential Revision: https://reviews.llvm.org/D44344
llvm-svn: 327523
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D44358
llvm-svn: 327326
|
|
|
|
|
|
|
|
|
|
| |
Previously we created __wasm_call_ctors with null InputFunction, and
added the InputFunction later. Now we create the SyntheticFunction with
null body, and set the body later.
Differential Revision: https://reviews.llvm.org/D44206
llvm-svn: 327149
|
|
|
|
| |
llvm-svn: 326896
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D44149
llvm-svn: 326885
|
|
|
|
|
|
|
|
|
| |
This avoids the Writer unnecessarily having a member to retain ownership
of the function body.
Differential Revision: https://reviews.llvm.org/D43933
llvm-svn: 326580
|
|
|
|
|
|
|
|
|
|
|
| |
The problem I want to address now is that chunks have too many data
members for "offsets", and their origins are not well defined.
For example, InputSegment has OutputSegmentOffset, but it's base class
also has OutputOffset. That's very confusing.
Differential Revision: https://reviews.llvm.org/D43726
llvm-svn: 326291
|
|
|
|
|
|
|
|
| |
{set,get}OutputSegment don't hide anything, so remove them.
Differential Revision: https://reviews.llvm.org/D43724
llvm-svn: 326276
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change modified lld to in response the llvm change which
moved to a more explicit symbol table in the object format.
Based on patches by Nicholas Wilson:
1. https://reviews.llvm.org/D41955
2. https://reviews.llvm.org/D42585
The primary difference that we see in the test output is that
for relocatable (-r) output we now have symbol table which
replaces exports/imports and globals.
See: https://github.com/WebAssembly/tool-conventions/issues/38
Differential Revision: https://reviews.llvm.org/D43264
llvm-svn: 325861
|
|
|
|
|
|
|
|
|
| |
This header used to be needed here for the `OutRelocation` struct
but that no longer exists.
Differential Revision: https://reviews.llvm.org/D43516
llvm-svn: 325608
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes `OutRelocations` vector from the InputChunk and
directly consume `Relocations` vector instead. This should make the linker
faster because we don't create a temporary data structure, and it matches
the lld's design principle that we don't create temporary data structures
for object files but instead directly consume mmap'ed data whenever possible.
Differential Revision: https://reviews.llvm.org/D43491
llvm-svn: 325549
|
|
|
|
|
|
|
|
| |
Define toString(wasm::InputChunk *) and use that in MarkLive.cpp.
Differential Revision: https://reviews.llvm.org/D43434
llvm-svn: 325535
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D43405
llvm-svn: 325414
|
|
|
|
|
|
|
|
|
| |
It seems redundant to store this information twice. None of the
locations where this bit is checked care about the distinction.
Differential Revision: https://reviews.llvm.org/D43250
llvm-svn: 325046
|
|
|
|
| |
llvm-svn: 324716
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't include type signatures that are not referenced by
some relocation.
We don't include this in the -gc-sections settings since
we are always building the type section from scratch,
just like we do the table elements.
In the future we might want to unify the relocation
processing which is currently done once for gc-sections
and then again for building the sympathetic type and
table sections.
Differential Revision: https://reviews.llvm.org/D42747
llvm-svn: 323931
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this initial version we only GC symbols with `hidden` visibility since
other symbols we export to the embedder.
We could potentially modify this the future and only use symbols
explicitly passed via `--export` as GC roots.
This version of the code only does GC of data and code. GC for the
types section is coming soon.
Differential Revision: https://reviews.llvm.org/D42511
llvm-svn: 323842
|
|
|
|
|
|
|
|
|
|
| |
Summary: These are useful to upcoming addition of --gc-sections support.
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D42626
llvm-svn: 323623
|
|
|
|
| |
llvm-svn: 323622
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Rather than explicit Function or InputSegment points store a
pointer to the base class (InputChunk) and use llvm dynamic
casts when we need a subtype.
This change is useful for add the upcoming gc-section support
wants to deal with all input chunks.
Subscribers: aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D42625
llvm-svn: 323621
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we were ensuring that the "output index" for
InputFunctions was unique across all symbols that referenced
a function body, but allowing the same function body to have
multiple table indexes.
Now, we use the same mechanism for table indexes as we already
do for output indexes, ensuring that each InputFunction is only
placed in the table once.
This makes the LLD output table denser and smaller, but should
not change the behaviour.
Note that we still need the `Symbol::TableIndex` member, to
store the table index for function Symbols that don't have an
InputFunction, i.e. for address-taken imports.
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42476
llvm-svn: 323379
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TABLE relocations now store the function that is being refered
to indirectly.
See rL323165.
Also extend the call-indirect.ll a little.
Based on a patch by Nicholas Wilson!
llvm-svn: 323168
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simplify generation of "names" section by simply iterating
over the DefinedFunctions array.
This even fixes some bugs, judging by the test changes required.
Some tests are asserting that functions are named multiple times,
other tests are asserting that the "names" section contains the
function's alias rather than its original name
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42076
llvm-svn: 322751
|
|
|
|
|
|
|
|
| |
Also, remove trailing semicolons.
Patch by Nicholas Wilson!
llvm-svn: 322726
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42013
llvm-svn: 322423
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://bugs.llvm.org/show_bug.cgi?id=35533, and D40844
Things covered:
* Removing duplicate data segments (as determined by COMDATs emitted
by the frontend)
* Removing duplicate globals and functions in COMDATs
* Checking that each time a COMDAT is seen it has the same symbols
as at other times (ie it's a stronger check than simply giving all
the symbols in the COMDAT weak linkage)
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D40845
llvm-svn: 322415
|
|
|
|
|
|
|
|
|
|
|
| |
This change create a new synthetic function in the final
output binary which calls the static constructors in sequence.
See: https://github.com/WebAssembly/tool-conventions/issues/25
Differential Revision: https://reviews.llvm.org/D41893
llvm-svn: 322388
|