summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r--lld/ELF/InputFiles.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 64f688e1a96..7e3e1bbbb8a 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -78,6 +78,8 @@ ELFData<ELFT>::getSymbolsHelper(bool Local) {
}
template <class ELFT> void ELFData<ELFT>::initStringTable() {
+ if (!Symtab)
+ return;
ErrorOr<StringRef> StringTableOrErr = ELFObj.getStringTableForSymtab(*Symtab);
error(StringTableOrErr.getError());
StringTable = *StringTableOrErr;
OpenPOWER on IntegriCloud