This is split out from https://reviews.llvm.org/D40559 as requested.
It adds a new argument to wasm-lld, --undefined, with similar semantics to the ELF linker. It pulls in symbols from files contained within a .a archive, forcing them to be included even if the translation unit would not otherwise be pulled in.
Could you add test for when the undefined symbol is not found? i.e. -u foo should cause a certain linker error? (unless we decide it doesn't, see below.)
(You can just add that case to within this file I think).