commit | 15f349f76f076202a8569ffdf15db153168bf4a2 | [log] [tgz] |
---|---|---|
author | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | Fri Mar 09 16:30:44 2018 +0000 |
committer | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | Fri Mar 09 16:30:44 2018 +0000 |
tree | b7861b14e64ee98d74c8a5d50d7438f48a8ae39b | |
parent | 69df838b5298eb33b7f94c826e714f91abeafa53 [diff] [blame] |
[WebAssembly] Disallow weak undefined globals in the object format This implements https://github.com/WebAssembly/tool-conventions/pull/47 Differential Revision: https://reviews.llvm.org/D44201 llvm-svn: 327146
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp index 87ef0d9..a05948e 100644 --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -1024,6 +1024,9 @@ Imports.push_back(Import); WasmIndices[&WS] = NumFunctionImports++; } else if (WS.isGlobal()) { + if (WS.isWeak()) + report_fatal_error("undefined global symbol cannot be weak"); + wasm::WasmImport Import; Import.Module = WS.getModuleName(); Import.Field = WS.getName();