This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Report undefined symbols during scanRelocations
ClosedPublic

Authored by sbc100 on Jul 6 2019, 12:52 AM.

Details

Summary

This puts handling of undefined symbols in a single location. Its
also more in line with the ELF backend which only reports undefined
symbols based on relocations.

One side effect is that we no longer report undefined symbols that are
only referenced in GC'd sections.

This also fixes a crash reported in the emscripten toolchain:
https://github.com/emscripten-core/emscripten/issues/8930.

Event Timeline

sbc100 created this revision.Jul 6 2019, 12:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2019, 12:52 AM
kripken accepted this revision.Jul 7 2019, 5:16 PM
kripken added a subscriber: kripken.

This looks right to me, but I'm not an expert on this stuff.

This revision is now accepted and ready to land.Jul 7 2019, 5:16 PM
sbc100 updated this revision to Diff 208342.Jul 8 2019, 3:06 AM
  • Report undefined symbols when scanning relocations
sbc100 updated this revision to Diff 208351.Jul 8 2019, 3:20 AM
  • cleanup test
sbc100 retitled this revision from [lld][WebAssembly] Report undefined data relocations earlier to [lld][WebAssembly] Report undefined symbols during scanRelocations.Jul 8 2019, 3:22 AM
sbc100 edited the summary of this revision. (Show Details)
sbc100 edited the summary of this revision. (Show Details)
sbc100 added a reviewer: ruiu.
sbc100 added a comment.Jul 8 2019, 3:24 AM

I expanded this change a little. @ruiu PTAL.

ruiu accepted this revision.Jul 8 2019, 3:58 AM

LGTM

MaskRay added a subscriber: MaskRay.Jul 8 2019, 4:06 AM
MaskRay added inline comments.
lld/wasm/Relocations.cpp
36

Not using early-return pattern may be cleaner here?

sbc100 updated this revision to Diff 208445.Jul 8 2019, 9:37 AM
sbc100 edited the summary of this revision. (Show Details)
  • feedback
sbc100 marked an inline comment as done.Jul 8 2019, 9:37 AM
sbc100 updated this revision to Diff 208782.Jul 9 2019, 12:39 PM
  • cleanup
This revision was automatically updated to reflect the committed changes.