diff options
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 3e55dbb4655..bce506eb8ef 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -202,9 +202,12 @@ void elf::ObjectFile<ELFT>::parse(DenseSet<CachedHashStringRef> &ComdatGroups) { // They are identified and deduplicated by group name. This function // returns a group name. template <class ELFT> -StringRef elf::ObjectFile<ELFT>::getShtGroupSignature(const Elf_Shdr &Sec) { +StringRef +elf::ObjectFile<ELFT>::getShtGroupSignature(ArrayRef<Elf_Shdr> Sections, + const Elf_Shdr &Sec) { const ELFFile<ELFT> &Obj = this->ELFObj; - const Elf_Shdr *Symtab = check(Obj.getSection(Sec.sh_link)); + const Elf_Shdr *Symtab = + check(object::getSection<ELFT>(Sections, Sec.sh_link)); const Elf_Sym *Sym = Obj.getSymbol(Symtab, Sec.sh_info); StringRef Strtab = check(Obj.getStringTableForSymtab(*Symtab)); return check(Sym->getName(Strtab)); @@ -299,7 +302,9 @@ void elf::ObjectFile<ELFT>::initializeSections( switch (Sec.sh_type) { case SHT_GROUP: Sections[I] = &InputSection<ELFT>::Discarded; - if (ComdatGroups.insert(CachedHashStringRef(getShtGroupSignature(Sec))) + if (ComdatGroups + .insert( + CachedHashStringRef(getShtGroupSignature(ObjSections, Sec))) .second) continue; for (uint32_t SecIndex : getShtGroupEntries(Sec)) { |

