This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Convert to new "dylink.0" section format
ClosedPublic

Authored by sbc100 on Sep 10 2021, 4:53 AM.

Details

Summary

This format is based on sub-sections (like the "linking" and "name"
sections) and is therefore easier to extend going forward.

spec change: https://github.com/WebAssembly/tool-conventions/pull/170
binaryen change: https://github.com/WebAssembly/binaryen/pull/4141
wabt change: https://github.com/WebAssembly/wabt/pull/1707
emscripten change: https://github.com/emscripten-core/emscripten/pull/15019

Diff Detail

Event Timeline

sbc100 created this revision.Sep 10 2021, 4:53 AM
sbc100 requested review of this revision.Sep 10 2021, 4:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2021, 4:53 AM
sbc100 edited the summary of this revision. (Show Details)Sep 10 2021, 6:32 AM
sbc100 edited the summary of this revision. (Show Details)Sep 10 2021, 7:41 AM
sbc100 edited the summary of this revision. (Show Details)Sep 10 2021, 7:49 AM
sbc100 retitled this revision from [WebAssembly] Convert to new "dylink" section format to [WebAssembly] Convert to new "dylink.0" section format.
sbc100 updated this revision to Diff 371922.Sep 10 2021, 7:50 AM
sbc100 edited the summary of this revision. (Show Details)
  • remove unused line
sbc100 updated this revision to Diff 371925.Sep 10 2021, 8:00 AM
  • remove unused line
dschuff added inline comments.Sep 10 2021, 9:08 AM
llvm/tools/obj2yaml/wasm2yaml.cpp
54

So wasm2yaml will accept either name. Does work because the parsing goes through lib/Object, which knows how to handle the legacy section format?

sbc100 added inline comments.Sep 11 2021, 3:45 AM
llvm/tools/obj2yaml/wasm2yaml.cpp
54

Yes version are supported for now. And yes lib/Object hides the differences and exposes the same struct whichever version is used.

sbc100 updated this revision to Diff 372072.Sep 11 2021, 4:20 AM
  • rebase

Landing TBR so we can start testing with this in emscripten ASAP. Will modify or revert as needed.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 12 2021, 5:31 AM
This revision was automatically updated to reflect the committed changes.
RKSimon added inline comments.
llvm/lib/Object/WasmObjectFile.cpp
391

@sbc100 This is being reported as dead code by coverity - please can you take a look?

sbc100 added inline comments.Sep 29 2021, 7:30 AM
llvm/lib/Object/WasmObjectFile.cpp
391

Thanks for pointing that out: https://reviews.llvm.org/D110717