llvm.org GIT mirror llvm / fdc348b
Split getSHNDXTable in two. Some clients already have the section table available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285898 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 3 years ago
1 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8080 ErrorOr getStringTableForSymtab(const Elf_Shdr &Section) const;
8181
8282 ErrorOr> getSHNDXTable(const Elf_Shdr &Section) const;
83 ErrorOr> getSHNDXTable(const Elf_Shdr &Section,
84 Elf_Shdr_Range Sections) const;
8385
8486 void VerifyStrTab(const Elf_Shdr *sh) const;
8587
422424 template
423425 ErrorOr>
424426 ELFFile::getSHNDXTable(const Elf_Shdr &Section) const {
427 auto SectionsOrErr = sections();
428 if (std::error_code EC = SectionsOrErr.getError())
429 return EC;
430 return getSHNDXTable(Section, *SectionsOrErr);
431 }
432
433 template
434 ErrorOr>
435 ELFFile::getSHNDXTable(const Elf_Shdr &Section,
436 Elf_Shdr_Range Sections) const {
425437 assert(Section.sh_type == ELF::SHT_SYMTAB_SHNDX);
426438 auto VOrErr = getSectionContentsAsArray(&Section);
427439 if (std::error_code EC = VOrErr.getError())
428440 return EC;
429441 ArrayRef V = *VOrErr;
430 ErrorOr SymTableOrErr = getSection(Section.sh_link);
442 ErrorOr SymTableOrErr =
443 object::getSection(Sections, Section.sh_link);
431444 if (std::error_code EC = SymTableOrErr.getError())
432445 return EC;
433446 const Elf_Shdr &SymTable = **SymTableOrErr;