| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Differential Revision: https://reviews.llvm.org/D44977
llvm-svn: 332351
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D44311
llvm-svn: 330456
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes issues found on the wasm waterfall related to relocations
with addends. Undefined symbols, even those with addends should
always have a provisional value of zero. At least this is what llvm
emits (and I believe this is true for ELF too).
Differential Revision: https://reviews.llvm.org/D44451
llvm-svn: 327468
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D44358
llvm-svn: 327326
|
|
|
|
|
|
|
|
|
|
|
|
| |
Verify that the location where a relocation is about the be
applied contains the expected existing value.
This is essentially a sanity check to catch bugs in the compiler
and the linker.
Differential Revision: https://reviews.llvm.org/D44349
llvm-svn: 327325
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D44350
llvm-svn: 327232
|
|
|
|
|
|
|
|
|
| |
This error case is described in Linking.md. The operand for call requires
generation of a synthetic stub.
Differential Revision: https://reviews.llvm.org/D44028
llvm-svn: 327151
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D43849
llvm-svn: 326615
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D43966
llvm-svn: 326509
|
|
|
|
|
|
|
|
|
|
|
| |
This patch simplifies initializeSymbols. Since that function is called
at the tail context of ObjFile::parse, and the function is called only
once from that function, that's effectively just a continuation of
ObjFile::parse. So this patch merge it with ObjFile::parse.
Differential Revision: https://reviews.llvm.org/D43848
llvm-svn: 326296
|
|
|
|
|
|
|
|
| |
The main purpose of this change is to make initializeSymbols shorter.
Differential Revision: https://reviews.llvm.org/D43691
llvm-svn: 326285
|
|
|
|
|
|
|
|
|
|
|
|
| |
Looks like these accessor functions are a bit overly defensive, and
due to the amount of code, that part isn't easy to read. We have
code to log translation results in writeTo and writeRelocations, so
I don't think we need to log it again in these functions.
I think the new function is much easier to understand.
Differential Revision: https://reviews.llvm.org/D43713
llvm-svn: 326277
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, one function adds all types of undefined symbols. That
doesn't fit to the wasm's undefined symbol semantics well because
different types of undefined symbols are very different in wasm.
As a result, separate control flows merge in this addUndefined function
and then separate again for each type. That wasn't easy to read.
This patch separates the function into three functions. Now it is pretty
clear what we are doing for each undefined symbol type.
Differential Revision: https://reviews.llvm.org/D43697
llvm-svn: 326271
|
|
|
|
| |
llvm-svn: 326012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Purely a rename in preparation for adding new global symbol type.
We want to use GlobalSymbol to represent real wasm globals and
DataSymbol for pointers to things in linear memory (what ELF would
call STT_OBJECT).
This reduces the size the patch to add the explicit symbol table
which is coming soon!
Differential Revision: https://reviews.llvm.org/D43476
llvm-svn: 325645
|
|
|
|
|
|
|
|
|
| |
The profailing style in lld seem to be to not include such empty lines.
Clang-tidy/clang-format seem to handle this just fine.
Differential Revision: https://reviews.llvm.org/D43528
llvm-svn: 325629
|
|
|
|
|
|
|
|
| |
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D43496
llvm-svn: 325613
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D43416
llvm-svn: 325415
|
|
|
|
| |
llvm-svn: 325387
|
|
|
|
|
|
|
|
|
| |
This brings wasm into line with ELF and COFF in terms of
symbol types are represented.
Differential Revision: https://reviews.llvm.org/D43112
llvm-svn: 325150
|
|
|
|
|
|
|
|
|
| |
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: 324715
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
See: https://reviews.llvm.org/rL323901
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42751
llvm-svn: 323903
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42193
llvm-svn: 322745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Teach each input chunk how to write itself and apply its
own relocations.
Differential Revision: https://reviews.llvm.org/D41891
llvm-svn: 322212
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
This is a preparetory change for function gc which also
requires relocations to be copied in ranges like this.
Differential Revision: https://reviews.llvm.org/D41313
llvm-svn: 320948
|
|
|
|
| |
llvm-svn: 320772
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create the indirect function table based on symbols rather
than just duplicating the input entries. This has the
effect of de-duplicating the table.
This is a followup to the equivalent change made for globals:
https://reviews.llvm.org/D40859
Partially based on a patch by Nicholas Wilson:
https://reviews.llvm.org/D40845
Differential Revision: https://reviews.llvm.org/D40989
llvm-svn: 320428
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change cleans up the way wasm exports and globals
are generated, particualrly for -r/--relocatable where
globals need to be created and exported in order for
output relocations which reference them.
Remove the need for a per file GlobalIndexOffset and
instead set the output index for each symbol directly.
This simplifies the code in several places.
Differential Revision: https://reviews.llvm.org/D40859
llvm-svn: 320001
|
|
|
|
|
|
|
|
|
| |
This patch is to rename check CHECK and make it a C macro, so that
we can evaluate the second argument lazily.
Differential Revision: https://reviews.llvm.org/D40915
llvm-svn: 319974
|
|
|
|
|
|
|
|
|
| |
This file contained only a single function that was only
really needed in one place, so just inline it.
Differential Revision: https://reviews.llvm.org/D40870
llvm-svn: 319876
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D40824
llvm-svn: 319787
|