diff options
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)) |

