diff options
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/WasmObjectFile.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index 14b17bcfa5e..7a2769149ad 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -777,7 +777,11 @@ Error WasmObjectFile::parseRelocSection(StringRef Name, ReadContext &Ctx) { object_error::parse_failed); break; case wasm::R_WASM_GLOBAL_INDEX_LEB: - if (!isValidGlobalSymbol(Reloc.Index)) + // R_WASM_GLOBAL_INDEX_LEB are can be used against function and data + // symbols to refer to thier GOT enties. + if (!isValidGlobalSymbol(Reloc.Index) && + !isValidDataSymbol(Reloc.Index) && + !isValidFunctionSymbol(Reloc.Index)) return make_error<GenericBinaryError>("Bad relocation global index", object_error::parse_failed); break; |