[WebAssembly] Fix R_WEBASSEMBLY_FUNCTION_OFFSET_I32 relocation entries

Fixes: lld: warning: unexpected existing value for R_WEBASSEMBLY_FUNCTION_OFFSET_I32: existing=839 expected=838

The existing solution is trying to erroneously recover correct offset of
the function code from the body (which is not a function segment that
includes its size, locals, and code).

The D46763 is trying to maintain the offset of the function code
allowing properly calculate the new relocation entry.

Patch by Yury Delendik

Differential Revision: https://reviews.llvm.org/D46765

llvm-svn: 332412
diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h
index b816ff8..80a8ab4 100644
--- a/lld/wasm/InputChunks.h
+++ b/lld/wasm/InputChunks.h
@@ -134,8 +134,8 @@
   StringRef getName() const override { return Function->SymbolName; }
   StringRef getDebugName() const override { return Function->DebugName; }
   uint32_t getComdat() const override { return Function->Comdat; }
-  const ArrayRef<uint8_t> getFunctionBody() const { return Function->Body; }
   uint32_t getFunctionInputOffset() const { return getInputSectionOffset(); }
+  uint32_t getFunctionCodeOffset() const { return Function->CodeOffset; }
   uint32_t getFunctionIndex() const { return FunctionIndex.getValue(); }
   bool hasFunctionIndex() const { return FunctionIndex.hasValue(); }
   void setFunctionIndex(uint32_t Index);