From 0d9ba4fe26725cacc7253fc3c72c4574f26bc099 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 24 Dec 2017 01:00:50 +0000 Subject: Vendor import of lld trunk r321414: https://llvm.org/svn/llvm-project/lld/trunk@321414 --- wasm/InputFiles.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'wasm/InputFiles.cpp') diff --git a/wasm/InputFiles.cpp b/wasm/InputFiles.cpp index e7463da39db97..1a1a6812c48ed 100644 --- a/wasm/InputFiles.cpp +++ b/wasm/InputFiles.cpp @@ -198,13 +198,22 @@ void ObjFile::initializeSymbols() { DEBUG(dbgs() << "Function: " << WasmSym.ElementIndex << " -> " << toString(*S) << "\n"); FunctionSymbols[WasmSym.ElementIndex] = S; + if (WasmSym.HasAltIndex) + FunctionSymbols[WasmSym.AltIndex] = S; } else { DEBUG(dbgs() << "Global: " << WasmSym.ElementIndex << " -> " << toString(*S) << "\n"); GlobalSymbols[WasmSym.ElementIndex] = S; + if (WasmSym.HasAltIndex) + GlobalSymbols[WasmSym.AltIndex] = S; } } + DEBUG(for (size_t I = 0; I < FunctionSymbols.size(); ++I) + assert(FunctionSymbols[I] != nullptr); + for (size_t I = 0; I < GlobalSymbols.size(); ++I) + assert(GlobalSymbols[I] != nullptr);); + // Populate `TableSymbols` with all symbols that are called indirectly uint32_t SegmentCount = WasmObj->elements().size(); if (SegmentCount) { -- cgit v1.2.3