summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/relocatable.ll
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Allow multivalue signatures in object filesThomas Lively2019-10-181-3/+4
| | | | | | | | | | | | | | | | | Summary: Also changes the wasm YAML format to reflect the possibility of having multiple return types and to put the returns after the params for consistency with the binary encoding. Reviewers: aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69156 llvm-svn: 375283
* [lld][WebAssembly] Preserve symbol flags in --relocatable outputSam Clegg2019-09-231-1/+4
| | | | | | | | Fixes https://github.com/emscripten-core/emscripten/issues/8879 Differential Revision: https://reviews.llvm.org/D67729 llvm-svn: 372660
* [WebAssembly] Sort output data sections to place .bss lastThomas Lively2019-09-191-30/+30
| | | | | | | | | | | | | | | | | | | | Summary: This was always the intended behavior, but had not been implemented. This ordering is important for Emscripten when generating .mem files while compiling to JS, since only zeros at the end of initialized memory can be dropped. Fixes https://github.com/emscripten-core/emscripten/issues/8999 Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67736 llvm-svn: 372284
* [WebAssembly] Initialize memory in start functionThomas Lively2019-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: - `__wasm_init_memory` is now the WebAssembly start function instead of being called from `__wasm_call_ctors` or called directly by the runtime. - Adds a new synthetic data symbol `__wasm_init_memory_flag` that is atomically incremented from zero to one by the thread responsible for initializing memory. - All threads now unconditionally perform data.drop on all passive segments. - Removes --passive-segments and --active-segments flags and controls segment type based on --shared-memory instead. The deleted flags were only present to ameliorate the upgrade path in Emscripten. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65783 llvm-svn: 370965
* [WebAssembly] Fix null pointer in createInitTLSFunctionGuanzhong Chen2019-08-061-175/+185
| | | | | | | | | | | | | | | | | | | | | Summary: `createSyntheticSymbols`, which creates `WasmSym::InitTLS`, is only called when `!config->relocatable`, but this condition is not checked when calling `createInitTLSFunction`. This diff checks `!config->relocatable` before calling `createInitTLSFunction`. Fixes https://github.com/emscripten-core/emscripten/issues/9155. Reviewers: tlively, aheejin, kripken, sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65785 llvm-svn: 368078
* [WebAssembly] Update MC for bulk memoryThomas Lively2019-02-191-6/+6
| | | | | | | | | | | | | | | | | | Summary: Rename MemoryIndex to InitFlags and implement logic for determining data segment layout in ObjectYAML and MC. Also adds a "passive" flag for the .section assembler directive although this cannot be assembled yet because the assembler does not support data sections. Reviewers: sbc100, aardappel, aheejin, dschuff Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57938 llvm-svn: 354397
* [WebAssembly] Update relocation naming to match llvm change. NFC.Sam Clegg2019-02-041-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D57698 llvm-svn: 353066
* [WebAssembly] Store section alignment as a power of 2Sam Clegg2019-01-161-7/+7
| | | | | | | | | | | This change bumps for version number of the wasm object file metadata. See https://github.com/WebAssembly/tool-conventions/pull/92 Differential Revision: https://reviews.llvm.org/D56762 llvm-svn: 351287
* [WebAssembly] Instruction renamingThomas Lively2019-01-081-1/+1
| | | | | | | | | | | | Summary: Associated with D56338. Reviewers: aheejin, aardappel Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56339 llvm-svn: 350610
* [WebAssembly] Remove final -wasm component of target triple. NFC.Sam Clegg2018-05-101-1/+1
| | | | | | This has been the default for a while now. llvm-svn: 332009
* [WebAssembly] Check function signatures by defaultSam Clegg2018-05-051-1/+1
| | | | | | | | | But only produce a warning (for now) unless --fatal-warnings is passed. Differential Revision: https://reviews.llvm.org/D46484 llvm-svn: 331574
* [WebAssembly] Add version to linking section (to match llvm-side change)Sam Clegg2018-04-261-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D46070 llvm-svn: 330971
* [WebAssembly] Reorder symbol table to match MC orderNicholas Wilson2018-02-281-30/+30
| | | | | | | | | Update LLD test expectations for new symbol ordering introduced by Differential D43685. Differential Revision: https://reviews.llvm.org/D43875 llvm-svn: 326335
* [WebAssembly] Remove DataSize from linking metadataSam Clegg2018-02-271-1/+0
| | | | | | | | | This means we don't need to write the linking metadata section at all for executable (non-relocatable) output. Differential Revision: https://reviews.llvm.org/D42869 llvm-svn: 326268
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-231-91/+71
| | | | | | | | | | | | | | | | | | 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
* Use wasm-ld instead of "lld -flavor wasm".Rui Ueyama2018-02-161-1/+1
| | | | | | | | | | Invoking lld as ld.lld, ld.ld64, lld-link or wasm-ld is preferred than invoking lld as lld and pass an -flavor option. We have "lld" file mostly for historical reasons. Differential Revision: https://reviews.llvm.org/D43407 llvm-svn: 325405
* [WebAssembly] Fix signature mismatches in test codeSam Clegg2018-02-021-1/+1
| | | | | | | | | Pass --check-signatures to test executions of lld and fix resulting errors. Differential Revision: https://reviews.llvm.org/D42661 llvm-svn: 324042
* [WebAssembly] Write minimal types sectionSam Clegg2018-01-311-7/+7
| | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Always start table index at 1, even for relocatable outputSam Clegg2018-01-241-6/+6
| | | | | | | | | | | | 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
* [WebAssembly] Use inline target tripple in test casesSam Clegg2018-01-241-2/+4
| | | | | | | | | | This is somewhat preferable since (in many cases) it allows llc to be run directly on the .ll files without having to pass the `-mtriple` argument. Differential Revision: https://reviews.llvm.org/D42438 llvm-svn: 323299
* [WebAssembly] Update to match llvm changes to TABLE relocationsSam Clegg2018-01-231-1/+1
| | | | | | | | | | | | | 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
* [WebAssembly] Include SYMBOL_INFO for imports as well as exportsSam Clegg2018-01-191-0/+2
| | | | | | | | | | Only effects --emit-relocs/--relocatable Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42306 llvm-svn: 322994
* [WebAssembly] Include weak imports when linking with --relocatableSam Clegg2018-01-191-23/+59
| | | | | | | | | | We need these import since relocations are generated against them. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42305 llvm-svn: 322990
* [WebAssembly] Add missing function exports and SYM_INFO to --relocatable outputSam Clegg2018-01-181-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Simplify generation of "names" sectionSam Clegg2018-01-171-0/+2
| | | | | | | | | | | | | | | | 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
* [WebAssembly] Add COMDAT supportSam Clegg2018-01-121-11/+53
| | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Update YAML in tests to match LLVM changeSam Clegg2018-01-091-6/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D41878 llvm-svn: 322122
* [WebAssembly] Write out undefined symbol addresses as zeroSam Clegg2018-01-081-1/+1
| | | | | | | | | | | | | 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
* [WebAssemlby] Fix typo in target triple used in testsSam Clegg2017-12-191-2/+2
| | | | llvm-svn: 321044
* [WebAssembly] Update YAML expected output after llvm changeSam Clegg2017-12-141-5/+5
| | | | | | | | See: https://reviews.llvm.org/D41202 Differential Revision: https://reviews.llvm.org/D41210 llvm-svn: 320662
* Remove trailing whitespace.Rui Ueyama2017-12-121-30/+30
| | | | llvm-svn: 320520
* [WebAssembly] Improve wasm test casesSam Clegg2017-12-081-5/+2
| | | | | | | | | | | | | | | | Add test for weakly defined symbols with the same name Improve test for call-indirect to include the same call in two different objects. This lays the ground work to improve the output via de-duplicating the indirect call table: https://reviews.llvm.org/D40989 Also make all tests consistently pass -mtriple rather than declaring in the sources. Differential Revision: https://reviews.llvm.org/D41024 llvm-svn: 320172
* [WebAssembly] Fix symbol exports under -r/--relocatableSam Clegg2017-12-071-0/+12
| | | | | | | | | | | | | | | 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] Initial wasm linker implementationSam Clegg2017-11-171-0/+185
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