This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fixed DWARF DW_AT_low_pc encoded as 64-bit in wasm64
ClosedPublic

Authored by aardappel on Oct 30 2020, 2:37 PM.

Details

Summary

Also added general wasm64 DWARF test.
Also added asserts for unsupported reloc combinations that triggered this bug.

Diff Detail

Event Timeline

aardappel created this revision.Oct 30 2020, 2:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2020, 2:37 PM
aardappel requested review of this revision.Oct 30 2020, 2:37 PM
aardappel retitled this revision from [WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files to [WebAssembly] Fixed DWARF DW_AT_low_pc encoded as 64-bit in wasm64.Oct 30 2020, 2:39 PM
dschuff accepted this revision.Oct 30 2020, 3:53 PM

LGTM for now.
As I said, I have a feeling we may need to do something more to get the data address space right. But this is fine to avoid crashing.

llvm/test/MC/WebAssembly/dwarfdump64.ll
2

It might make sense to use the dwarfdump argument --show-form for this test, then we can see which attributes have addr vs other forms.

39

I have a feeling that this is probably wrong (i.e. it's 4 instead of 8). Maybe we should put a TODO here.

This revision is now accepted and ready to land.Oct 30 2020, 3:53 PM
dschuff added inline comments.Oct 30 2020, 3:54 PM
llvm/test/MC/WebAssembly/dwarfdump64.ll
39

(I mean that it's using a 4-byte address instead of an 8-byte. not that the value is wrong)

aardappel updated this revision to Diff 302042.Oct 30 2020, 4:40 PM
aardappel marked 3 inline comments as done.

updated test for --show-form and added TODO

The paths in this test only worked on Windows. A fix has been pushed in b093eba08478db387fc2765dee1e1bf2d64fcf68