summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-06-16 23:59:10 +0000
committerSam Clegg <sbc@chromium.org>2017-06-16 23:59:10 +0000
commit9d24fb7ff318d7a88f0fa3e63eb0df4acafd9805 (patch)
tree831fda1fcb2d777624a62553479acb958f043e43 /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parent4f1fca270acd736cbde43773d1fd83b3b3d2164f (diff)
downloadbcm5719-llvm-9d24fb7ff318d7a88f0fa3e63eb0df4acafd9805.tar.gz
bcm5719-llvm-9d24fb7ff318d7a88f0fa3e63eb0df4acafd9805.zip
[WebAssembly] Use __stack_pointer global when writing wasm binary
This ensures that symbolic relocations are generated for stack pointer manipulations. These relocations are of type R_WEBASSEMBLY_GLOBAL_INDEX_LEB. This change also adds support for reading relocations of this type in WasmObjectFile.cpp. Since its a globally imported symbol this does mean that the get_global/set_global instruction won't be valid until the objects are linked that global used in no longer an imported global. Differential Revision: https://reviews.llvm.org/D34172 llvm-svn: 305616
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index b999091e2d2..f51585a10ca 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -96,13 +96,6 @@ void WebAssemblyAsmPrinter::EmitEndOfAsmFile(Module &M) {
MCConstantExpr::create(Size, OutContext));
}
}
-
- if (!TM.getTargetTriple().isOSBinFormatELF()) {
- MachineModuleInfoWasm &MMIW = MMI->getObjFileInfo<MachineModuleInfoWasm>();
- getTargetStreamer()->emitGlobal(MMIW.getGlobals());
- if (MMIW.hasStackPointerGlobal())
- getTargetStreamer()->emitStackPointer(MMIW.getStackPointerGlobal());
- }
}
void WebAssemblyAsmPrinter::EmitConstantPool() {
OpenPOWER on IntegriCloud