This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Fix for string merging + negative addends
ClosedPublic

Authored by sbc100 on May 11 2021, 12:19 PM.

Details

Summary

Don't include the relocation addend when calculating the
virtual address of a symbol. Instead just pass the symbol's
offset and add the addend afterwards.

Without this fix we hit the offset is outside the section
error in MergeInputSegment::getSegmentPiece.

This fixes a real world error we were are seeing in emscripten.

Diff Detail

Event Timeline

sbc100 created this revision.May 11 2021, 12:19 PM
sbc100 requested review of this revision.May 11 2021, 12:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2021, 12:19 PM
dschuff accepted this revision.May 11 2021, 4:59 PM
This revision is now accepted and ready to land.May 11 2021, 4:59 PM