Index: llvm/trunk/include/llvm/BinaryFormat/Wasm.h =================================================================== --- llvm/trunk/include/llvm/BinaryFormat/Wasm.h +++ llvm/trunk/include/llvm/BinaryFormat/Wasm.h @@ -102,6 +102,7 @@ ArrayRef Body; uint32_t CodeSectionOffset; uint32_t Size; + uint32_t CodeOffset; // start of Locals and Body StringRef SymbolName; // from the "linking" section StringRef DebugName; // from the "name" section uint32_t Comdat; // from the "comdat info" section Index: llvm/trunk/lib/Object/WasmObjectFile.cpp =================================================================== --- llvm/trunk/lib/Object/WasmObjectFile.cpp +++ llvm/trunk/lib/Object/WasmObjectFile.cpp @@ -875,6 +875,7 @@ uint32_t Size = readVaruint32(Ptr); const uint8_t *FunctionEnd = Ptr + Size; + Function.CodeOffset = Ptr - FunctionStart; Function.Index = NumImportedFunctions + Functions.size(); Function.CodeSectionOffset = FunctionStart - CodeSectionStart; Function.Size = FunctionEnd - FunctionStart;