diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-02-23 18:17:11 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-02-23 18:17:11 +0000 |
| commit | c89bff2ce1b58de373612b22f500456db3320deb (patch) | |
| tree | b9e90dc6b3762b72a90afd882af2eb9ad4e97bdd /lld/ELF/InputFiles.cpp | |
| parent | 4b3bb213b2d21d862542cfe1965fbd4cab28f1a8 (diff) | |
| download | bcm5719-llvm-c89bff2ce1b58de373612b22f500456db3320deb.tar.gz bcm5719-llvm-c89bff2ce1b58de373612b22f500456db3320deb.zip | |
Handle bitcode files in archive files with --whole-archive.
This patch moves BitcodeFile instantiation into createObjectFile.
Previously, we handle bitcode files outside that function and did
not handle for --whole-archive.
http://reviews.llvm.org/D17527
llvm-svn: 261663
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 5a942ba0ab4..2ba02fc4df6 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -491,7 +491,12 @@ static std::unique_ptr<InputFile> createELFFile(MemoryBufferRef MB) { std::unique_ptr<InputFile> elf2::createObjectFile(MemoryBufferRef MB, StringRef ArchiveName) { - std::unique_ptr<InputFile> F = createELFFile<ObjectFile>(MB); + using namespace sys::fs; + std::unique_ptr<InputFile> F; + if (identify_magic(MB.getBuffer()) == file_magic::bitcode) + F.reset(new BitcodeFile(MB)); + else + F = createELFFile<ObjectFile>(MB); F->ArchiveName = ArchiveName; return F; } |

