This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] MC: Include unnamed data when writing wasm files
ClosedPublic

Authored by sbc100 on May 10 2017, 4:27 PM.

Details

Summary

Also, include global entries for all data symbols, not
just external ones, since these are referenced by the
relocation records.

Add a test case that includes unnamed data.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.May 10 2017, 4:27 PM
sbc100 updated this revision to Diff 98558.May 10 2017, 4:30 PM
  • cleanup
sbc100 updated this revision to Diff 98559.May 10 2017, 4:32 PM
  • add more test checks
dschuff added inline comments.May 10 2017, 4:43 PM
lib/MC/WasmObjectWriter.cpp
698 ↗(On Diff #98559)

How are we hitting the line you took out, when this is still here?

dschuff added inline comments.May 10 2017, 4:46 PM
lib/MC/WasmObjectWriter.cpp
698 ↗(On Diff #98559)

Oh, wait this are unnamed too. So we still want to ignore unnamed temporaries.

sbc100 added inline comments.May 15 2017, 8:52 AM
lib/MC/WasmObjectWriter.cpp
698 ↗(On Diff #98559)

If the comment is correct then yes.

@sunfish can you take a look?

sbc100 added inline comments.May 17 2017, 3:44 PM
test/MC/WebAssembly/unnamed_data.ll
53 ↗(On Diff #98559)

I guess this type of test is too brittle and I should simply not check for the Content here or the exact offsets of the relocs above?

sunfish accepted this revision.May 18 2017, 4:20 PM

lgtm

This revision is now accepted and ready to land.May 18 2017, 4:20 PM
This revision was automatically updated to reflect the committed changes.

I don't think this change can effect anything other than the wasm target. The failures you link to look like they are occurring with other targets such as -mtriple arm-apple-darwin