HomePhabricator

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

Authored by sbc100 on May 11 2021, 8:58 AM.

Description

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

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.

Differential Revision: https://reviews.llvm.org/D102271