[WebAssembly] Fix local references to weak aliases
commit5b1a4e4b7f144ef894f61c8bb45254154c85539a
authorSam Clegg <sbc@chromium.org>
Thu, 21 Dec 2017 02:30:38 +0000 (21 02:30 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 21 Dec 2017 02:30:38 +0000 (21 02:30 +0000)
treeea4aa795e838d6fd7283840f66088908c540cb8d
parent7f4699ff8ff6ddef8170ec3fbd232c56a74699c3
[WebAssembly] Fix local references to weak aliases

When weak aliases are used with in same translation
unit we need to be able to directly reference to alias
and not just the thing it is aliases.  We do this by
defining both a wasm import and a wasm export in this
case that result in a single Symbol.  This change is
a partial revert of rL314245.  A corresponding lld
change address the previous issues we had with this.

See: https://github.com/WebAssembly/tool-conventions/issues/34

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321242 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/Wasm.h
lib/MC/WasmObjectWriter.cpp
lib/Object/WasmObjectFile.cpp
test/MC/WebAssembly/weak-alias.ll