This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] MC: Create wasm data segments based on MCSections
ClosedPublic

Authored by sbc100 on Sep 14 2017, 4:56 PM.

Details

Summary

This means that we can honor -fdata-sections rather than always creating
a segment for each symbol.

It also allows for a followup change to add .init_array and friends.

Event Timeline

sbc100 created this revision.Sep 14 2017, 4:56 PM
sbc100 edited the summary of this revision. (Show Details)Sep 14 2017, 4:58 PM
sbc100 added a reviewer: dschuff.
sbc100 added a subscriber: llvm-commits.
sbc100 updated this revision to Diff 115343.Sep 14 2017, 7:22 PM

More section types

dschuff edited edge metadata.Sep 15 2017, 10:11 AM

Should the patch title be "create data *segments* based on MCSections"?

lib/MC/WasmObjectWriter.cpp
515

Does this mean we don't support the .p2align directive?
If so, we should have a TODO to fix it. Or do we just expect it to get converted and we should never see this (in other words, can it be an assert instead)?

sbc100 retitled this revision from [WebAssembly] MC: Create data sections based on MCSections to [WebAssembly] MC: Create wasm data segments based on MCSections.Sep 15 2017, 12:11 PM
sbc100 updated this revision to Diff 115459.Sep 15 2017, 12:44 PM
  • support custom data sections

Added support for explicit custom section names, and added new test

lib/MC/WasmObjectWriter.cpp
515

I'm not sure why this is here but we haven't been seeing this show up in testing yet. I'm only moving this code. I'd rather not also change it in this CL.

sbc100 updated this revision to Diff 115461.Sep 15 2017, 12:46 PM
  • rename test
dschuff accepted this revision.Sep 15 2017, 12:49 PM
This revision is now accepted and ready to land.Sep 15 2017, 12:49 PM
This revision was automatically updated to reflect the committed changes.