[WebAssembly] Error on archives without a symbol index
authorSam Clegg <sbc@chromium.org>
Tue, 25 Jun 2019 17:49:35 +0000 (17:49 +0000)
committerSam Clegg <sbc@chromium.org>
Tue, 25 Jun 2019 17:49:35 +0000 (17:49 +0000)
commit61d70e4a93daa07529e2d0a59697ae694cbef7b5
treef1da97a01fd0aad75f74928fba21d7bd10c9bacb
parent4577b8c17c1a87c65c257a7c73f3bc4bb18b63e8
[WebAssembly] Error on archives without a symbol index

This is fairly common with wasm since GNU ar (most likely the system ar)
doesn't support the wasm object format so user who don't override AR
will end up with archives without an index.  We don't want to silently
ignore this issue.

In the future we could choose to instead behave like the ELF backend and
read the symbols from each object file in the archive if they are all of
the same type.  However, error'ing out seem like a conservative approach
for now.

Fixes: PR42376
Differential Revision: https://reviews.llvm.org/D63739

llvm-svn: 364338
lld/test/wasm/archive-no-index.ll [new file with mode: 0644]
lld/wasm/Driver.cpp