summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Migrate function attribute "no-frame-pointer-elim"="false" to ↵Fangrui Song2019-12-242-4/+4
| | | | "frame-pointer"="none" as cleanups after D56351
* [WebAssembly] Allow multivalue signatures in object filesThomas Lively2019-10-182-2/+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][WebAssebmly] Preserve custom import attributes with LTOSam Clegg2019-10-171-0/+10
| | | | | | | | | | | | | | | | | | | Undefined symbols in WebAssembly can come with custom `import-module` and `import-field` attributes. However when reading symbols from bitcode object files during LTO those curtom attributes are not available. Once we compile the LTO object and read in the symbol table from the object file we have access to these custom attributes. In this case, when undefined symbols are added and a symbol already exists in the SymbolTable we can't simple return it, we may need to update the symbol's attributes. Fixes: PR43211 Differential Revision: https://reviews.llvm.org/D68959 llvm-svn: 375081
* [WebAssembly] Elide data segments for .bss sectionsThomas Lively2019-10-152-6/+6
| | | | | | | | | | | | | | | | | | | Summary: WebAssembly memories are zero-initialized, so when module does not import its memory initializing .bss sections is guaranteed to be a no-op. To reduce binary size and initialization time, .bss sections are simply not emitted into the final binary unless the memory is imported. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68965 llvm-svn: 374940
* [lld][WebAssembly] Create optional symbols after handling --export/--undefinedSam Clegg2019-08-271-0/+7
| | | | | | | | | | | Handling of --export/--undefined can pull in lazy symbols which in turn can pull in referenced to optional symbols. We need to delay the creation of optional symbols until all possible references to them have been created. Differential Revision: https://reviews.llvm.org/D66768 llvm-svn: 370012
* [lld][WebAssembly] Fix handling of comdat functions in init array.Sam Clegg2019-07-172-4/+4
| | | | | | | | | | | | | | | | | When hidden symbols are discarded by comdat rules we still want to create a local defined symbol, otherwise `Symbol::isDiscarded()` relies on begin able to check `getChunk->discarded`. This is a followup on rL362769. The comdat.ll test was previously GC'ing the `__wasm_call_ctors` functions so `do_init` was not actually being included in the link. Once that function was included in triggered the crash bug that this change addresses. Fixes: https://github.com/emscripten-core/emscripten/issues/8981 Differential Revision: https://reviews.llvm.org/D64872 llvm-svn: 366358
* [lld][WebAssembly] Fix __start/__stop symbols when combining input segmentsSam Clegg2019-07-081-0/+4
| | | | | | | | | | | | We should be generating one __start/__stop pair per output segment not per input segment. The test wasn't catching this because it was only linking a single object file. Fixes PR41565 Differential Revision: https://reviews.llvm.org/D64148 llvm-svn: 365308
* [WebAssembly] Fix for discarded init functionsSam Clegg2019-06-072-14/+32
| | | | | | | | | 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
* [WebAssembly] Target features sectionThomas Lively2019-03-204-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implements a new target features section in assembly and object files that records what features are used, required, and disallowed in WebAssembly objects. The linker uses this information to ensure that all objects participating in a link are feature-compatible and records the set of used features in the output binary for use by optimizers and other tools later in the toolchain. The "atomics" feature is always required or disallowed to prevent linking code with stripped atomics into multithreaded binaries. Other features are marked used if they are enabled globally or on any function in a module. Future CLs will add linker flags for ignoring feature compatibility checks and for specifying the set of allowed features, implement using the presence of the "atomics" feature to control the type of memory and segments in the linked binary, and add front-end flags for relaxing the linkage policy for atomics. Reviewers: aheejin, sbc100, dschuff Subscribers: jgravelle-google, hiraditya, sunfish, mgrang, jfb, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59173 llvm-svn: 356610
* [WebAssembly] Don't generate invalid modules when function signatures mismatchSam Clegg2019-02-201-0/+11
| | | | | | | | | | | | Previously we could emit a warning and generate a potentially invalid wasm module (due to call sites and functions having conflicting signatures). Now, rather than create invalid binaries we handle such cases by creating stub functions containing unreachable, effectively turning these into runtime errors rather than validation failures. Differential Revision: https://reviews.llvm.org/D57909 llvm-svn: 354528
* [WebAssembly] Update relocation naming to match llvm change. NFC.Sam Clegg2019-02-042-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D57698 llvm-svn: 353066
* [WebAssembly] Store section alignment as a power of 2Sam Clegg2019-01-162-2/+2
| | | | | | | | | | | 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] Add support for the event sectionHeejin Ahn2018-12-082-0/+18
| | | | | | | | | | | | | | | | | Summary: This adds support for the 'event section' specified in the exception handling proposal. Wasm exception handling binary model spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model Reviewers: sbc100, ruiu Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54875 llvm-svn: 348703
* [WebAssembly] Fix archive member display in error messagesSam Clegg2018-07-182-0/+16
| | | | | | | | | Add a test for this by causing a symbol collision between archive members. Differential Revision: https://reviews.llvm.org/D49343 llvm-svn: 337426
* [WebAssembly] Minor cleanup to test inputs. NFC.Sam Clegg2018-06-202-4/+2
| | | | | | | | | | | Update load-undefined.test such that it doesn't rely on ret32 and ret64 having default visibility. Split out from: https://reviews.llvm.org/D48394 Differential Revision: https://reviews.llvm.org/D48403 llvm-svn: 335187
* [WebAssembly] Fix crash when relocation synbol is not liveSam Clegg2018-05-232-38/+44
| | | | | | | | | | | | | | | | When a symbol is GC'd it can still be references by relocations in the debug sections, but such symbols are not assigned virtual addresses. This change adds a new global data symbol which gets GC'd but should still appears in the output debug info, albeit with a 0 address. Fixes 37555 Differential Revision: https://reviews.llvm.org/D47238 llvm-svn: 333047
* [WebAssembly] Allow signautre of entry function to be flexibleSam Clegg2018-05-141-1/+1
| | | | | | | | | Since we a no longer using this function for the wasm start section we don't actually care what its signature is. Differential Revision: https://reviews.llvm.org/D46594 llvm-svn: 332308
* [WebAssembly] Remove final -wasm component of target triple. NFC.Sam Clegg2018-05-1021-21/+21
| | | | | | This has been the default for a while now. llvm-svn: 332009
* [wasm] Update test for variables->retainedNodes rename.Benjamin Kramer2018-05-092-3/+3
| | | | | | This fixes the test after LLVM r331841. llvm-svn: 331862
* [WebAssembly] Add support for debug (DWARF) sectionsSam Clegg2018-05-042-0/+132
| | | | | | | | | | | | | | 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
* [WebAssembly] Add version to linking section (to match llvm-side change)Sam Clegg2018-04-262-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D46070 llvm-svn: 330971
* [WebAssembly] Implement -print-gc-sections, to better test GC of globalsNicholas Wilson2018-04-201-0/+53
| | | | | | Differential Revision: https://reviews.llvm.org/D44311 llvm-svn: 330456
* [WebAssembly] Implement GC for importsNicholas Wilson2018-04-201-0/+51
| | | | | | Differential Revision: https://reviews.llvm.org/D44313 llvm-svn: 330454
* [WebAssembly] Add support for custom sectionsSam Clegg2018-04-101-0/+6
| | | | | | | | | Copy user-defined custom sections into the output, concatenating sections with the same name. Differential Revision: https://reviews.llvm.org/D45340 llvm-svn: 329717
* [WebAssembly] Check signatures of weakly defined funtions tooSam Clegg2018-02-201-0/+6
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43492 llvm-svn: 325598
* [WebAssembly] Reduce redundancy in testsSam Clegg2018-01-311-0/+6
| | | | | | | | | | | | Add a simple start entry point input file and have the tests reference that rather than duplicating these. This allows more tests to be pure `.test` files rather than `.ll`. Differential Revision: https://reviews.llvm.org/D42662 llvm-svn: 323838
* [WebAssembly] Use inline target tripple in test casesSam Clegg2018-01-2416-0/+32
| | | | | | | | | | 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-5/+6
| | | | | | | | | | | | | 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] Add missing function exports and SYM_INFO to --relocatable outputSam Clegg2018-01-182-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Add COMDAT supportSam Clegg2018-01-122-0/+22
| | | | | | | | | | | | | | | | | | 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] Create synthetic __wasm_call_ctors functionSam Clegg2018-01-121-2/+10
| | | | | | | | | | | 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] Increase test coverage for weak aliasesSam Clegg2017-12-221-9/+5
| | | | | | | | LLVM-side is now fixed Differential Revision: https://reviews.llvm.org/D41511 llvm-svn: 321385
* [WebAssembly] Add extra test for weak global symbolsSam Clegg2017-12-212-0/+4
| | | | | | | | | | | | | | | | | Summary: Currently the test only checks behaviour for weak function symbols. Should be good to merge straight away? Reviewers: sbc100 Reviewed By: sbc100 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D41449 llvm-svn: 321308
* [WebAssembly] Improve weak alias tests casesSam Clegg2017-12-211-4/+32
| | | | | | | | | | | Based on: https://github.com/WebAssembly/tool-conventions/issues/34 Currently weak-alias-overide.ll exhibits incorrect behaviour in that call_direct() calls the wrong function. Differential Revision: https://reviews.llvm.org/D41460 llvm-svn: 321241
* [WebAssembly] Add support for writing out init functions in linking sectionSam Clegg2017-12-191-0/+14
| | | | | | | | | This change add support for init functions in the linking section, but only in -r/--relocatable mode. Differential Revision: https://reviews.llvm.org/D41375 llvm-svn: 321088
* [WebAssembly] Improve wasm test casesSam Clegg2017-12-089-21/+24
| | | | | | | | | | | | | | | | 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
* Reland "[WebAssembly] Add support for visibility flag""Sam Clegg2017-12-035-5/+19
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D40773 llvm-svn: 319627
* [WebAssembly] Revert r319592 "Add support for visibility flag"Heejin Ahn2017-12-025-19/+5
| | | | | | | | | r319488 reportedly broke one of LLVM bots (ubuntu-gcc7.1-werror), and this patch depends on that patch. See http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3369 for details. llvm-svn: 319603
* [WebAssembly] Add support for visibility flagSam Clegg2017-12-015-5/+19
| | | | | | | | Patch by Nicholas Wilson Differential Revision: https://reviews.llvm.org/D40690 llvm-svn: 319592
* [WebAssembly] Initial wasm linker implementationSam Clegg2017-11-178-0/+857
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