summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/call-pic.ll
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Limit PIC support to the Emscripten targetDan Gohman2019-06-051-1/+1
| | | | | | | | | | | The current PIC support currently only works with Emscripten, so disable it for other targets. This is the PIC portion of https://reviews.llvm.org/D62542. Reviewed By: dschuff, sbc100 llvm-svn: 362638
* [WebAssembly] Don't assume that strongly defined symbols are DSO-localSam Clegg2019-05-101-1/+1
| | | | | | | | | | | | | | | | 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
* [WebAssembly] FastISel: Don't fallback to SelectionDAG after BuildMI in ↵Sam Clegg2019-04-191-0/+15
| | | | | | | | | | | | | | | | | selectCall My understanding is that once BuildMI has been called we can't fallback to SelectionDAG. This change moves the fallback for when getRegForValue() fails for that target of an indirect call. This was failing in -fPIC mode when the callee is GlobalValue. Add a test case that tickles this. Differential Revision: https://reviews.llvm.org/D60908 llvm-svn: 358793
* [WebAssembly] Add new explicit relocation types for PIC relocationsSam Clegg2019-04-041-3/+3
| | | | | | | | See https://github.com/WebAssembly/tool-conventions/pull/106 Differential Revision: https://reviews.llvm.org/D59907 llvm-svn: 357710
* [WebAssembly] Initial implementation of PIC code generationSam Clegg2019-03-261-0/+52
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
OpenPOWER on IntegriCloud