HomePhabricator

[MC][WebAssembly] Fix provisional values for data alias relocations

Authored by sbc100 on Feb 7 2021, 6:51 PM.

Description

[MC][WebAssembly] Fix provisional values for data alias relocations

When calculating the symbol offsets to write as provisitonal values
in object files we are only interested in the offset of the symbol
itself. For aliases this offset already includes the offset of the
base symbol.

The testin question was added back in https://reviews.llvm.org/D87407
but I believe the expectations here were incorrect. sym_a lives
at offset 4 and sym_b lives 4 bytes into that (should be 8).

The addresses of the 3 symbosl in this object file are:

foo : 0
sym_a: 4
sym_b: 8

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