summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 121e1f98f3e..d37057fc391 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -466,6 +466,10 @@ Error WasmObjectFile::parseLinkingSectionSymtab(const uint8_t *&Ptr,
break;
case wasm::WASM_SYMBOL_TYPE_SECTION: {
+ if ((Info.Flags & wasm::WASM_SYMBOL_BINDING_MASK) !=
+ wasm::WASM_SYMBOL_BINDING_LOCAL)
+ return make_error<GenericBinaryError>("Section symbol must have local binding",
+ object_error::parse_failed);
Info.ElementIndex = readVaruint32(Ptr);
// Use somewhat unique section name as symbol name.
StringRef SectionName = Sections[Info.ElementIndex].Name;
OpenPOWER on IntegriCloud