summaryrefslogtreecommitdiffstats
path: root/lld/wasm/Driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Run clang-format. NFCNicholas Wilson2018-03-071-2/+2
| | | | llvm-svn: 326896
* [WebAssembly] Do not use default arguments for SymbolTable.Rui Ueyama2018-02-281-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D43727 llvm-svn: 326282
* [WebAssembly] Separate addUndefined into addUndefined{Function,Data,Global}.Rui Ueyama2018-02-281-7/+3
| | | | | | | | | | | | | | | 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
* [WebAssebmly] Minor simplification. NFC.Rui Ueyama2018-02-241-5/+6
| | | | llvm-svn: 326013
* Inline printHelp.Rui Ueyama2018-02-231-5/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43526 llvm-svn: 325953
* Handle --version before handling --mllvm.Rui Ueyama2018-02-231-5/+6
| | | | | | | | Because it's a waste of time to handle --mllvm before --version. Differential Revision: https://reviews.llvm.org/D43527 llvm-svn: 325952
* Inline a trivial ctor.Rui Ueyama2018-02-231-15/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43525 llvm-svn: 325948
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-231-5/+18
| | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Rename GlobalSymbol types. NFC.Sam Clegg2018-02-201-4/+4
| | | | | | | | | | | | | | | 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
* [WebAssembly] Remove unused headerSam Clegg2018-02-201-1/+1
| | | | llvm-svn: 325624
* Do not print out "no input files" twice.Rui Ueyama2018-02-161-6/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D43408 llvm-svn: 325406
* [WebAssembly] Cleanup methods for add synthetic symbols to symbtab. NFC.Sam Clegg2018-02-131-9/+17
| | | | | | | | | | | | These were duplicating (incorrectly) some of the logic for handling conflicts, but since they are only ever added right at the start we can assume no existing symbols. Also rename these methods for clarity. Differential Revision: https://reviews.llvm.org/D43252 llvm-svn: 325045
* [WebAssembly] Add __data_end link-sythentic symbol.Sam Clegg2018-02-071-0/+1
| | | | | | | | | | | | | | This is similar to _end (See https://linux.die.net/man/3/edata for more) but using our own unique name since our use cases will most likely be different and we want to keep our options open WRT to memory layout. This change will allow is to remove the DataSize from the linking metadata section which is currently being used by emscripten to derive the end of the data. Differential Revision: https://reviews.llvm.org/D42867 llvm-svn: 324443
* [WebAssembly] Refactor linker-generated symbols. NFC.Sam Clegg2018-02-021-13/+4
| | | | | | | | | | | | Group all synthetic symbols in the in single struct to match the ELF linker. This change is part of a larger change to add more linker symbols such as `_end` and `_edata`. Differential Revision: https://reviews.llvm.org/D42866 llvm-svn: 324157
* [WebAssembly] Add support for --gc-sectionsSam Clegg2018-01-311-5/+19
| | | | | | | | | | | | | | | 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
* [WebAssembly] Remove --emit-relocsSam Clegg2018-01-221-3/+0
| | | | | | | | | | 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
* [WebAssembly] Remove special handling of entry point export.Sam Clegg2018-01-201-1/+5
| | | | | | | | | | | | 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
* [WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC.Sam Clegg2018-01-201-10/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D42327 llvm-svn: 323024
* [WebAssembly] Remove custom handling for undefined entrySam Clegg2018-01-201-2/+0
| | | | | | | | | | | 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
* [WebAssembly] Define __heap_base globalSam Clegg2018-01-171-0/+1
| | | | | | | | | 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
* [WebAssembly] Create synthetic __dso_handle symbolSam Clegg2018-01-171-0/+9
| | | | | | | | | | | | | 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
* [WebAssembly] Add --export flag to force a symbol to be exportedSam Clegg2018-01-121-4/+13
| | | | | | | | | | 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
* [WebAssembly] Create synthetic __wasm_call_ctors functionSam Clegg2018-01-121-3/+4
| | | | | | | | | | | 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
* [WebAssembly] When loading libraries look for companion `.imports` fileSam Clegg2018-01-111-6/+24
| | | | | | | | | | | | | | | | | | 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
* Remove redundant local variables.Rui Ueyama2017-12-111-2/+1
| | | | llvm-svn: 320436
* Reduce indentation.Rui Ueyama2017-12-111-2/+2
| | | | llvm-svn: 320433
* Sort.Rui Ueyama2017-12-111-2/+2
| | | | llvm-svn: 320394
* Change function type more LLVM-ish.Rui Ueyama2017-12-111-2/+2
| | | | | | Also fix variable naming style. llvm-svn: 320393
* [WebAssembly] Add --no-entry argumentSam Clegg2017-12-081-13/+19
| | | | | | | | | | | This adds a `--no-entry` argument to wasm LLD used to suppress the default `_start` entry point. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D40725 llvm-svn: 320167
* [WebAssembly] Add check to ensure symbol VA is only set once. NFC.Sam Clegg2017-12-081-12/+1
| | | | | | | | Also remove resulting unneeded function. Differential Revision: https://reviews.llvm.org/D40990 llvm-svn: 320118
* [WebAssembly] Remove used variableSam Clegg2017-12-071-1/+0
| | | | llvm-svn: 320007
* [WebAssembly] Add -u/--undefined argument handlingSam Clegg2017-12-071-0/+18
| | | | | | | | | | | | | | Adds a new argument to wasm-lld, `--undefined`, with similar semantics to the ELF linker. It pulls in symbols from files contained within a `.a` archive, forcing them to be included even if the translation unit would not otherwise be pulled in. Patch by Nicholas Wilson Differential Revision: https://reviews.llvm.org/D40724 llvm-svn: 320004
* [WebAssembly] Fix symbol exports under -r/--relocatableSam Clegg2017-12-071-1/+0
| | | | | | | | | | | | | | | 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
* [WebAssembly] Fix stack pointer relocationsSam Clegg2017-12-051-0/+1
| | | | | | | | | | This line was mistakenly deleted in rL319813 Add a test for stackpointer relocations. Differential Revision: https://reviews.llvm.org/D40847 llvm-svn: 319828
* [WebAssembly] Improve support linker synthetic symbolsSam Clegg2017-12-051-10/+5
| | | | | | | | | | | | | This is part of larger change to add synthetic symbols for section start/end points and init/fini_array: https://reviews.llvm.org/D40760 Allows synthetic global symbols to have an explicitly set virtual address. Differential Revision: https://reviews.llvm.org/D40843 llvm-svn: 319813
* [WebAssembly] Remove used --sysroot optionSam Clegg2017-12-051-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D40771 llvm-svn: 319805
* [WebAssembly] Simplify check for emitting relocationsSam Clegg2017-12-051-0/+2
| | | | | | | | | | | This is a small change I split of from a larger one that simplifies the condition that need to be checked when decided if we need to emit relocation and all the things they depend on (symbols, etc). Differential Revision: https://reviews.llvm.org/D40825 llvm-svn: 319789
* clang-format.Rui Ueyama2017-12-011-1/+1
| | | | llvm-svn: 319512
* [WebAssembly] Fix typosSam Clegg2017-12-011-1/+1
| | | | | | | | Patch by Nicholas Wilson Differential Revision: https://reviews.llvm.org/D40691 llvm-svn: 319506
* [WebAssembly] Allow function signature checking at link timeSam Clegg2017-11-301-3/+7
| | | | | | | | | | | | | | This change allows checking of function signatures but does not yes enable it by default. In this mode, linking two objects that were compiled with a different signatures for the same function will produce a link error. New options for enabling and disabling this feature have been added: (--check-signatures/--no-check-signatures). Differential Revision: https://reviews.llvm.org/D40371 llvm-svn: 319396
* Fix spelling. NFC.Rui Ueyama2017-11-281-1/+1
| | | | llvm-svn: 319238
* Remove unused `using`.Rui Ueyama2017-11-281-1/+0
| | | | llvm-svn: 319236
* Move Memory.{h,cpp} to Common.Rui Ueyama2017-11-281-3/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D40571 llvm-svn: 319221
* Factor out more code to Common/Args.cpp.Rui Ueyama2017-11-281-53/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D40540 llvm-svn: 319211
* [WebAssembly] Initial wasm linker implementationSam Clegg2017-11-171-0/+357
This linker backend is still a work in progress but is enough to link simple programs including linking against library archives. Differential Revision: https://reviews.llvm.org/D34851 llvm-svn: 318539
OpenPOWER on IntegriCloud