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.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 041b41fd2d9..ec8958b898d 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -292,6 +292,7 @@ void elf::ObjectFile<ELFT>::initializeSections(
Sections.resize(Size);
unsigned I = -1;
const ELFFile<ELFT> &Obj = this->ELFObj;
+ StringRef SectionStringTable = check(Obj.getSectionStringTable());
for (const Elf_Shdr &Sec : Obj.sections()) {
++I;
if (Sections[I] == &InputSection<ELFT>::Discarded)
@@ -328,7 +329,7 @@ void elf::ObjectFile<ELFT>::initializeSections(
case SHT_NULL:
break;
default:
- Sections[I] = createInputSection(Sec);
+ Sections[I] = createInputSection(Sec, SectionStringTable);
}
}
}
@@ -373,8 +374,9 @@ elf::ObjectFile<ELFT>::getRelocTarget(const Elf_Shdr &Sec) {
template <class ELFT>
InputSectionBase<ELFT> *
-elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec) {
- StringRef Name = check(this->ELFObj.getSectionName(&Sec));
+elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec,
+ StringRef SectionStringTable) {
+ StringRef Name = check(this->ELFObj.getSectionName(&Sec, SectionStringTable));
switch (Sec.sh_type) {
case SHT_ARM_ATTRIBUTES:
OpenPOWER on IntegriCloud