mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 07:01:03 +08:00
[llvm/Object] - Remove ELFFile<ELFT>::getSection(const StringRef SectionName). NFC.
This method is dead. It was introduced in D47989, but now the logic from D63475 is used in llvm-readobj instead. Also it has a problem: it returns the first matching section, even if there are multiple sections with the same name. Differential revision: https://reviews.llvm.org/D65393 llvm-svn: 367833
This commit is contained in:
@@ -271,7 +271,6 @@ public:
|
||||
Elf_Sym_Range Symtab,
|
||||
ArrayRef<Elf_Word> ShndxTable) const;
|
||||
Expected<const Elf_Shdr *> getSection(uint32_t Index) const;
|
||||
Expected<const Elf_Shdr *> getSection(const StringRef SectionName) const;
|
||||
|
||||
Expected<const Elf_Sym *> getSymbol(const Elf_Shdr *Sec,
|
||||
uint32_t Index) const;
|
||||
@@ -568,23 +567,6 @@ ELFFile<ELFT>::getSection(uint32_t Index) const {
|
||||
return object::getSection<ELFT>(*TableOrErr, Index);
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
Expected<const typename ELFT::Shdr *>
|
||||
ELFFile<ELFT>::getSection(const StringRef SectionName) const {
|
||||
auto TableOrErr = sections();
|
||||
if (!TableOrErr)
|
||||
return TableOrErr.takeError();
|
||||
for (auto &Sec : *TableOrErr) {
|
||||
auto SecNameOrErr = getSectionName(&Sec);
|
||||
if (!SecNameOrErr)
|
||||
return SecNameOrErr.takeError();
|
||||
if (*SecNameOrErr == SectionName)
|
||||
return &Sec;
|
||||
}
|
||||
// TODO: this error is untested.
|
||||
return createError("invalid section name");
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
Expected<StringRef>
|
||||
ELFFile<ELFT>::getStringTable(const Elf_Shdr *Section) const {
|
||||
|
||||
Reference in New Issue
Block a user