This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Improve readobj and nm support for wasm
ClosedPublic

Authored by sbc100 on Mar 30 2017, 3:42 PM.

Details

Summary

Now that the libObect support for wasm is better we can
have readobj and nm produce more useful output too.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Mar 30 2017, 3:42 PM
dschuff added inline comments.Apr 3 2017, 1:12 PM
test/tools/llvm-readobj/file-headers.test
29 ↗(On Diff #93556)

using generated using?

tools/llvm-readobj/WasmDumper.cpp
159 ↗(On Diff #93556)

Should we also print the numeric value of the symbol type, as in other formats?

Actually come to think of it we don't specify (or document externally) what those are, maybe we should.

sbc100 updated this revision to Diff 93962.Apr 3 2017, 3:53 PM
sbc100 retitled this revision from [WebAssembly] Improve readobj and nm support for wasm Now that the libObect support for wasm is better we can have readobj and nm produce more useful output too. to [WebAssembly] Improve readobj and nm support for wasm.
sbc100 edited the summary of this revision. (Show Details)
  • Merge remote-tracking branch 'origin/master' into better_nm_readobj_support
  • use printEnum in WasmDumper.cpp
sbc100 marked an inline comment as done.Apr 3 2017, 3:57 PM
sbc100 added inline comments.
tools/llvm-readobj/WasmDumper.cpp
159 ↗(On Diff #93556)

Fixed by switching to printEnum.

I agree we should document these types, probably in https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md.

One interesting aspect is that these symbol types are synthetic in that the numeric types don't actually exist in the object file, they mostly exist (in memory only) to enable tools such as nm to distinguish where the symbol came from.

dschuff accepted this revision.Apr 11 2017, 12:35 PM
This revision is now accepted and ready to land.Apr 11 2017, 12:35 PM
This revision was automatically updated to reflect the committed changes.