diff options
| author | Sam Clegg <sbc@chromium.org> | 2019-07-03 02:29:02 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2019-07-03 02:29:02 +0000 |
| commit | 99745896cedbbee5ec9c0343a055e12ccd5d5113 (patch) | |
| tree | 6f12788427dc5e896d564dd71ce3a1d9a858b445 /lld/ELF/Driver.cpp | |
| parent | ba5a72ff8dc7486d7101c0190bb29d716b75a402 (diff) | |
| download | bcm5719-llvm-99745896cedbbee5ec9c0343a055e12ccd5d5113.tar.gz bcm5719-llvm-99745896cedbbee5ec9c0343a055e12ccd5d5113.zip | |
[ELF] Error on archive with missing index
This matches the wasm lld and GNU ld behavior.
The ELF linker has special handling for bitcode archives but if that
doesn't kick in we probably want to error out rather than silently
ignore the library.
Differential Revision: https://reviews.llvm.org/D63781
llvm-svn: 364998
Diffstat (limited to 'lld/ELF/Driver.cpp')
| -rw-r--r-- | lld/ELF/Driver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 008a6cd7954..af5bd241bb8 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -223,8 +223,10 @@ void LinkerDriver::addFile(StringRef Path, bool WithLOption) { // default action without the LTO hack described above. for (const std::pair<MemoryBufferRef, uint64_t> &P : getArchiveMembers(MBRef)) - if (identify_magic(P.first.getBuffer()) != file_magic::bitcode) + if (identify_magic(P.first.getBuffer()) != file_magic::bitcode) { + error(Path + ": archive has no index; run ranlib to add one"); return; + } for (const std::pair<MemoryBufferRef, uint64_t> &P : getArchiveMembers(MBRef)) |

