[PATCH] D46763: [WebAssembly] Provide WasmFunction content offset informatin.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 11:09:52 PDT 2018


sbc100 accepted this revision.
sbc100 added a subscriber: aardappel.
sbc100 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Object/WasmObjectFile.cpp:878
 
+    Function.CodeOffset = Ptr - FunctionStart;
     Function.Index = NumImportedFunctions + Functions.size();
----------------
As an alternative, perhaps we could just move the `const uint8_t *FunctionStart = Ptr;` down a couple of lines so that the function body no longer includes its size?

The downside would be that the linker would need to re-encode the size for each function.

@aardappel was recently looking making `objdump -d` work and he ran into issues relating to pointer the actual start of the instructions.

Having said all that, this seems like a perfectly reasonable interim fix.


Repository:
  rL LLVM

https://reviews.llvm.org/D46763





More information about the llvm-commits mailing list