summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/shared.ll
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Use Emscripten triples in PIC tests.Dan Gohman2019-06-051-1/+1
| | | | | | | | With r362638, llc doesn't support -relocation-model=pic with non-Emscripten triples. Update these tests in lld which use -relocation-model=pic to also use Emscripten triples. llvm-svn: 362645
* [WebAssembly] Don't assume that strongly defined symbols are DSO-localSam Clegg2019-05-101-8/+13
| | | | | | | | | | | | | | | | The current PIC model for WebAssembly is more like ELF in that it allows symbol interposition. This means that more functions end up being addressed via the GOT and fewer directly added to the wasm table. One effect is a reduction in the number of wasm table entries similar to the previous attempt in https://reviews.llvm.org/D61539 which was reverted. Differential Revision: https://reviews.llvm.org/D61772 llvm-svn: 360402
* Revert "[WebAssembly] Don't generate unused table entries."Sam Clegg2019-05-091-5/+5
| | | | | | | | This reverts commit b33fdb7768e5de5fbeb23f65d8d455e7ca88b021. This change apparently broke am emscripten test. llvm-svn: 360367
* [WebAssembly] Don't generate unused table entries.Sam Clegg2019-05-071-5/+5
| | | | | | | | | | | | | | When generating PIC output only relocations of type R_WASM_TABLE_INDEX_REL_SLEB should generate table entries. R_WASM_TABLE_INDEX_I32 get resolved at runtime via the auto-generated __wasm_apply_relocs functions. R_WASM_TABLE_INDEX_SLEB are not allowed in PIC code. Differential Revision: https://reviews.llvm.org/D61539 llvm-svn: 360165
* [WebAssembly] Always take into account added when applying runtime relocationsSam Clegg2019-04-251-3/+14
| | | | | | | | | | | The code we generate for applying data relocations at runtime omitted the symbols with GOT entries. Also refactor the code to reduce duplication. Differential Revision: https://reviews.llvm.org/D61111 llvm-svn: 359207
* [WebAssembly] Assign GOT entries symbols used in data relocationsSam Clegg2019-04-101-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D60492 llvm-svn: 358090
* [WebAssembly] Include function in wasm table when used in ↵Sam Clegg2019-04-051-5/+12
| | | | | | | | | | | | R_WASM_TABLE_INDEX_REL_SLEB This should have been part of rL357710 but was overlooked because in our test code the function in question was also used in other relocations that caused it to be added to the table anyway. Differential Revision: https://reviews.llvm.org/D60296 llvm-svn: 357737
* [WebAssembly] Apply data relocations at runtime in shared objectsSam Clegg2019-04-041-3/+24
| | | | | | | | | | | | | See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md Data section relocations in wasm shared libraries are applied by the library itself at static constructor time. This change adds a new synthetic function that applies relocations to relevant memory locations on startup. Differential Revision: https://reviews.llvm.org/D59278 llvm-svn: 357715
* [WebAssembly] Initial implementation of PIC code generationSam Clegg2019-03-261-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | This change implements lowering of references global symbols in PIC mode. This change implements lowering of global references in PIC mode using a new @GOT reference type. @GOT references can be used with function or data symbol names combined with the get_global instruction. In this case the linker will insert the wasm global that stores the address of the symbol (either in memory for data symbols or in the wasm table for function symbols). For now I'm continuing to use the R_WASM_GLOBAL_INDEX_LEB relocation type for this type of reference which means that this relocation type can refer to either a global or a function or data symbol. We could choose to introduce specific relocation types for GOT entries in the future. See the current dynamic linking proposal: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md Differential Revision: https://reviews.llvm.org/D54647 llvm-svn: 357022
* [WebAssembly] Error on R_WASM_MEMORY_ADDR relocations against undefined data ↵Sam Clegg2019-03-161-11/+13
| | | | | | | | | | | | | | symbols. For these types of relocations an absolute memory address is required which is not possible for undefined data symbols. For symbols that can be undefined at link time (i.e. external data symbols in shared libraries) a different type of relocation (i.e. via a GOT) will be needed. Differential Revision: https://reviews.llvm.org/D59337 llvm-svn: 356310
* [WebAssembly] Improve support for "needed" list in dylink sectionSam Clegg2019-03-131-0/+2
| | | | | | | | | | | This change adds basic support for shared library dependencies via the dylink section. See https://github.com/WebAssembly/tool-conventions/pull/77 Differential Revision: https://reviews.llvm.org/D59237 llvm-svn: 356102
* [WebAssembly] Handle undefined data symbols in shared librariesSam Clegg2019-03-121-5/+14
| | | | | | | | | | | | When linking shared libraries, we import a mutable wasm global to represent the address of each undefined data symbol. This is a step towards supporting dynamic linking and shared libraries. Differential Revision: https://reviews.llvm.org/D59270 llvm-svn: 355988
* [WebAssebmly] Allow __wasm_call_ctors to be GC'edSam Clegg2019-03-011-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D58806 llvm-svn: 355240
* [WebAssembly] Update MC for bulk memoryThomas Lively2019-02-191-1/+1
| | | | | | | | | | | | | | | | | | 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] Instruction renamingThomas Lively2019-01-081-3/+3
| | | | | | | | | | | | 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] Don't set a maximum size when importing the tableSam Clegg2018-12-031-2/+0
| | | | | | | | | We shouldn't be setting setting a max size for a table that is being imported. Differential Revision: https://reviews.llvm.org/D55231 llvm-svn: 348204
* [WebAssembly] Allow undefined symbols when building shared librariesSam Clegg2018-11-291-10/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D55043 llvm-svn: 347909
* [WebAssembly] Import the stack pointer when building shared librariesSam Clegg2018-11-151-2/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D54558 llvm-svn: 346974
* [WebAssembly] Initial support for shared objects (-shared)Sam Clegg2018-11-151-0/+70
Based on the initial spec proposal: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md The llvm/codegen side of this is still missing but I believe this change is still worth landing as an incremental step Differential Revision: https://reviews.llvm.org/D54249 llvm-svn: 346918
OpenPOWER on IntegriCloud