This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add data size and alignment to linking section
ClosedPublic

Authored by sbc100 on Jun 26 2017, 5:33 PM.

Details

Summary

The overal size of the data section (including BSS)
is otherwise not include in the wasm binary.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Jun 26 2017, 5:33 PM
sbc100 retitled this revision from [WebAssembly] Add data size and alignement to linking section to [WebAssembly] Add data size and alignment to linking section.Jun 26 2017, 5:33 PM
sbc100 added a reviewer: dschuff.
sbc100 added a subscriber: llvm-commits.
dschuff added inline comments.Jun 27 2017, 10:19 AM
lib/MC/WasmObjectWriter.cpp
887 ↗(On Diff #104050)

It looks like these sections will come out of order wrt their enum values above. Should we just make data size and alignment be numbers 0 and 1?

932 ↗(On Diff #104050)

Maybe we should make the min data alignment be 1? Should we have 0 or missing alignment be some default? Maybe the default should just be the min too. Or we could have the min be 4; in general I guess we'd probably want numbers to have min alignment of 4 (which we can also set in the compiler), but for strings maybe we don't care and can let it be less?

sbc100 updated this revision to Diff 104235.Jun 27 2017, 12:27 PM
sbc100 marked an inline comment as done.
  • - add default alignment of 1
lib/MC/WasmObjectWriter.cpp
932 ↗(On Diff #104050)

Changed the default to 1 for now. We can revisit this when I update Linking.md

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