This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add Object and ObjectWriter support for wasm COMDAT sections
ClosedPublic

Authored by dschuff on Dec 4 2020, 2:11 PM.

Details

Summary
Allow sections to be placed into COMDAT groups, in addition to functions and data
segments.

Also make section symbols unnamed, which allows sections with identical names
(section names are independent of their section symbols, but previously we
gave the symbols the same name as their sections, which results in collisions
when sections are identically-named).

Diff Detail

Event Timeline

dschuff created this revision.Dec 4 2020, 2:11 PM
dschuff updated this revision to Diff 309653.Dec 4 2020, 2:12 PM

Add the rest

sbc100 added a comment.Dec 4 2020, 2:36 PM

Looks great!

llvm/test/MC/WebAssembly/comdat-sections.ll
8

Where does this name come from?

dschuff published this revision for review.Dec 4 2020, 4:05 PM

This version basically just tests -fdebug-types-section end-to-end to YAML via comdats. (It probably needs more tests, suggestions are welcome)
I'm thinking it would be good to add assembly syntax so we can test just the MC and Object stuff separately from the debuginfo stuff. Not sure if that should be a separate change?

Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 4:05 PM
dschuff added inline comments.
llvm/test/MC/WebAssembly/comdat-sections.ll
8

The name is just the hash of the dwarf description of the type. So duplicate types will get duplicate names.

dschuff updated this revision to Diff 309693.Dec 4 2020, 4:09 PM
  • clang-format
dschuff retitled this revision from [WIP] Add Object and ObjectWriter support for wasm COMDAT sections to [WebAssembly] Add Object and ObjectWriter support for wasm COMDAT sections.Dec 7 2020, 9:13 AM
dschuff edited the summary of this revision. (Show Details)

I'm going to add assembly support in a separate change. So this change is ready for review; it has the end-to-end test, and when I add assembler support I'll add tests that go from ll -> asm and asm -> YAML

sbc100 accepted this revision.Dec 7 2020, 9:27 AM
sbc100 added inline comments.
llvm/include/llvm/BinaryFormat/Wasm.h
334

Can you upload a PR to tooling-conventions to add this ?

This revision is now accepted and ready to land.Dec 7 2020, 9:27 AM
dschuff updated this revision to Diff 309979.Dec 7 2020, 11:57 AM

rebase, fix typo

This revision was landed with ongoing or failed builds.Dec 7 2020, 12:14 PM
This revision was automatically updated to reflect the committed changes.