[lld][WebAssembly] Add optional symbols after input file handling
authorSam Clegg <sbc@chromium.org>
Thu, 8 Aug 2019 16:58:36 +0000 (16:58 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 8 Aug 2019 16:58:36 +0000 (16:58 +0000)
commitcaa0db13181e97b1c62a65168227b80cbdc2ac5e
treec96d05d974406a6c470f4895cb1d0d704fc2d239
parent0e5eef5c8f47e4715e8ef694fb1e28c0a825a57f
[lld][WebAssembly] Add optional symbols after input file handling

This allows undefined references in input files be resolved by the
optional symbols.  Previously we were doing this before input file
reading which means it was working only for command line symbols
references (i.e. -u or --export).

Also use addOptionalDataSymbol for __dso_handle and make all optional
symbols hidden by default.

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

llvm-svn: 368310
lld/test/wasm/global-base.test
lld/test/wasm/optional-symbol.ll [new file with mode: 0644]
lld/test/wasm/stack-first.test
lld/wasm/Driver.cpp
lld/wasm/SymbolTable.cpp
lld/wasm/SymbolTable.h