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.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index a5f84320ca3..ef4333ff9d8 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -41,6 +41,10 @@ template <class ELFT> void elf2::ObjectFile<ELFT>::initializeChunks() {
uint64_t Size = ELFObj->getNumSections();
Chunks.reserve(Size);
for (const Elf_Shdr &Sec : ELFObj->sections()) {
+ if (Sec.sh_type == SHT_SYMTAB) {
+ Symtab = &Sec;
+ continue;
+ }
if (Sec.sh_flags & SHF_ALLOC) {
auto *C = new (Alloc) SectionChunk<ELFT>(this->getObj(), &Sec);
Chunks.push_back(C);
@@ -49,7 +53,6 @@ template <class ELFT> void elf2::ObjectFile<ELFT>::initializeChunks() {
}
template <class ELFT> void elf2::ObjectFile<ELFT>::initializeSymbols() {
- const Elf_Shdr *Symtab = ELFObj->getDotSymtabSec();
ErrorOr<StringRef> StringTableOrErr =
ELFObj->getStringTableForSymtab(*Symtab);
error(StringTableOrErr.getError());
OpenPOWER on IntegriCloud