[PATCH] D56684: [WebAssembly] Fixed objdump not parsing function headers.

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 14 14:58:00 PST 2019


aardappel created this revision.
aardappel added reviewers: sbc100, dschuff.
Herald added subscribers: llvm-commits, rupprecht, sunfish, aheejin, jgravelle-google.

objdump was interpreting the function header containing the locals
declaration as instructions. To parse these without injecting target
specific code in objdump, MCDisassembler::onSymbolStart was added to
be implemented by the WebAssembly implemention.

WasmObjectFile now returns a code offset for the "address" of a symbol,
rather than the index. This is also more in-line with what other
targets do.

Also ensured that the AsmParser correctly puts each function
in its own segment to enable this test case.


Repository:
  rL LLVM

https://reviews.llvm.org/D56684

Files:
  include/llvm/MC/MCDisassembler/MCDisassembler.h
  include/llvm/Object/Wasm.h
  lib/MC/MCDisassembler/MCDisassembler.cpp
  lib/MC/MCParser/WasmAsmParser.cpp
  lib/Object/WasmObjectFile.cpp
  lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
  lib/Target/WebAssembly/Disassembler/LLVMBuild.txt
  lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp
  test/MC/WebAssembly/objdump.s
  test/MC/WebAssembly/weak-alias.ll
  test/tools/llvm-objdump/WebAssembly/symbol-table.test
  tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56684.181655.patch
Type: text/x-patch
Size: 16350 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190114/0d065193/attachment-0001.bin>


More information about the llvm-commits mailing list