| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42627
llvm-svn: 323624
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 323620
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously llvm was using 0 as the first table index for wasm object
files but now that has switched to 1 we can have the output of lld
do the same and simplify the code.
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42096
llvm-svn: 323378
|
|
|
|
| |
llvm-svn: 323286
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This was added to mimic ELF, but maintaining it has cost
and we currently don't have any use for it outside of the
test code.
Differential Revision: https://reviews.llvm.org/D42324
llvm-svn: 323154
|
|
|
|
|
|
|
|
|
|
|
|
| |
Its much easier to export it via setHidden(false), now that
that is a thing.
As a side effect the start function is not longer always exports first
(becuase its being exported just like all the other function).
Differential Revision: https://reviews.llvm.org/D42321
llvm-svn: 323025
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42327
llvm-svn: 323024
|
|
|
|
|
|
|
|
|
|
|
| |
This code was needed back when we were not able to write
out the synthetic symbol for main.
Add tests to make sure we can handle this now.
Differential Revision: https://reviews.llvm.org/D42322
llvm-svn: 323020
|
|
|
|
|
|
|
|
|
|
| |
Only effects --emit-relocs/--relocatable
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42306
llvm-svn: 322994
|
|
|
|
|
|
|
|
|
|
| |
We need these import since relocations are generated against them.
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42305
llvm-svn: 322990
|
|
|
|
|
|
|
|
|
|
| |
Summary: This change enables D42284 to land without breaking lld
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D42285
llvm-svn: 322976
|
|
|
|
|
|
| |
Some compilers don't like this and generate a warning.
llvm-svn: 322921
|
|
|
|
|
|
|
|
|
|
|
|
| |
This solves the problem that --emit-relocs needs the stack-pointer
to be exported, in order to write out any relocations that reference
the __stack_pointer symbol by its symbol index.
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42237
llvm-svn: 322911
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When writing relocatable files we were exporting for all globals
(including file-local syms), but not for functions. Oops. To be
consistent with non-relocatable output, all symbols (file-local
and global) should be exported. Any symbol targetted by further
relocations needs to be exported. The lack of local function
exports was just an omission, I think.
Second bug: Local symbol names can collide, causing an illegal
Wasm file to be generated! Oops again. This only previously affected
producing relocatable output from two files, where each had a global
with the same name. We need to "budge" the symbol names for locals
that are exported on relocatable output.
Third bug: LLD's relocatable output wasn't writing out any symbol
flags! Thus the local globals weren't being marked as local, and
the hidden flag was also stripped...
Added tests to exercise colliding local names with/without
relocatable flag
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42105
llvm-svn: 322908
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42193
llvm-svn: 322745
|
|
|
|
|
|
| |
Patch by Nicholas Wilson!
llvm-svn: 322732
|
|
|
|
|
|
| |
Patch by Nicholas Wilson!
llvm-svn: 322731
|
|
|
|
|
|
| |
Patch by Nicholas Wilson!
llvm-svn: 322727
|
|
|
|
|
|
|
|
| |
Also, remove trailing semicolons.
Patch by Nicholas Wilson!
llvm-svn: 322726
|
|
|
|
|
|
|
|
|
| |
This is an immutable exported global representing
the start of the heap area. It is a page aligned.
Differential Revision: https://reviews.llvm.org/D42030
llvm-svn: 322609
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is used by __cxa_ataxit to determine the currently
executing DLL. Once we fully support DLLs this will need
to be set to some address within the DLL.
The ELF linker added support for this symbol here:
https://reviews.llvm.org/D33856
Differential Revision: https://reviews.llvm.org/D42024
llvm-svn: 322606
|
|
|
|
|
|
|
|
| |
Oops, the waterfall tests with `-Werror -Wunused-variable`.
Differential Revision: https://reviews.llvm.org/D42028
llvm-svn: 322442
|
|
|
|
|
|
| |
This reverts commit 7421eab7ccf2e14518f4526a084a5afc76ac9c6a.
llvm-svn: 322441
|
|
|
|
|
|
|
| |
This should also fixe an unused varaible warning in the realeae
build.
llvm-svn: 322440
|
|
|
|
| |
llvm-svn: 322426
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 322412
|
|
|
|
|
|
|
|
|
|
| |
This is useful for emscripten or other tools that want to
selectively exports symbols without necessarily changing the
source code.
Differential Revision: https://reviews.llvm.org/D42003
llvm-svn: 322408
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Even though a function can have multiple names in the
linking standards (i.e. due to aliases), there can only
be one name for a given function in the NAME section.
Differential Revision: https://reviews.llvm.org/D41975
llvm-svn: 322383
|
|
|
|
| |
llvm-svn: 322337
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows libraries to supply a list of symbols which are
allowed to be undefined at link time (i.e. result in imports).
This method replaces the existing mechanism (-allow-undefined-file)
used by the clang driver to allow undefined symbols in libc.
For more on motivation for this see:
https://github.com/WebAssembly/tool-conventions/issues/35
In the long run we hope to remove this features and instead
include this information in the object format itself.
Differential Revision: https://reviews.llvm.org/D41922
llvm-svn: 322320
|
|
|
|
|
|
| |
Followup on https://reviews.llvm.org/D41894
llvm-svn: 322219
|
|
|
|
|
|
|
|
|
| |
Teach each input chunk how to write itself and apply its
own relocations.
Differential Revision: https://reviews.llvm.org/D41891
llvm-svn: 322212
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D41894
llvm-svn: 322211
|
|
|
|
|
|
|
|
| |
InputFunction. NFC.
Differential Revision: https://reviews.llvm.org/D41419
llvm-svn: 322148
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This WasmSymbol types comes directly from the input objects
but we want to be able to represent synthetic symbols too.
This is more in line with how the ELF linker represents symbols.
This change also removes the logic from Symbol::getVirtualAddress
for finding the global address and instead has the InputFile
provide this.
Differential Revision: https://reviews.llvm.org/D41426
llvm-svn: 322145
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code section is now written out one function
at a time rather than all the functions in a given
objects being serialized at once.
This change lays the groundwork for supporting
--gc-sections.
Differential Revision: https://reviews.llvm.org/D41315
llvm-svn: 322138
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The addresses of undefined symbols that make it into the final
executable (i.e. weak references to non-existent symbols) should
resolve to zero.
Also, make sure to not include function in the indirect function
table if they are not included in the output.
Differential Revision: https://reviews.llvm.org/D41839
llvm-svn: 322045
|
|
|
|
|
|
|
|
| |
Corresponding LLVM change: https://reviews.llvm.org/D41472
Differential Revision: https://reviews.llvm.org/D41473
llvm-svn: 321244
|
|
|
|
| |
llvm-svn: 321146
|
|
|
|
|
|
|
|
|
|
| |
Store data relocations with their respective segment.
This allows relocations to be applied as each segment
is written (and therefore in parallel).
Differential Revision: https://reviews.llvm.org/D41410
llvm-svn: 321105
|