summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SymbolTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SymbolTable.cpp')
-rw-r--r--lld/ELF/SymbolTable.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 43b068d6676..42b04596b89 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -28,15 +28,21 @@ bool SymbolTable::shouldUseRela() const {
}
void SymbolTable::addFile(std::unique_ptr<InputFile> File) {
- File->parse();
- InputFile *FileP = File.release();
- if (auto *AF = dyn_cast<ArchiveFile>(FileP)) {
+ if (auto *AF = dyn_cast<ArchiveFile>(File.get())) {
+ File.release();
ArchiveFiles.emplace_back(AF);
+ if (Config->WholeArchive) {
+ for (MemoryBufferRef &MBRef : AF->getMembers())
+ addFile(createELFFile<ObjectFile>(MBRef));
+ return;
+ }
+ AF->parse();
for (Lazy &Sym : AF->getLazySymbols())
addLazy(&Sym);
return;
}
- addELFFile(cast<ELFFileBase>(FileP));
+ File->parse();
+ addELFFile(cast<ELFFileBase>(File.release()));
}
static TargetInfo *createTarget(uint16_t EMachine) {
OpenPOWER on IntegriCloud