/// \brief The ELF file header.
Elf_Ehdr &Header;
+ SectionNameToIdxMap &SN2I;
+
public:
ELFState(Elf_Ehdr &Header_, ContiguousBlobAccumulator &Accum,
- unsigned DotStrtabSecNo_)
+ unsigned DotStrtabSecNo_, SectionNameToIdxMap &SN2I_)
: DotStrtab(), DotStrtabSecNo(DotStrtabSecNo_),
- SectionContentAccum(Accum), Header(Header_) {}
+ SectionContentAccum(Accum), Header(Header_), SN2I(SN2I_) {}
unsigned getDotStrTabSecNo() const { return DotStrtabSecNo; }
StringTableBuilder &getStringTable() { return DotStrtab; }
ContiguousBlobAccumulator &getSectionContentAccum() {
return SectionContentAccum;
}
+ SectionNameToIdxMap &getSN2I() { return SN2I; }
};
} // end anonymous namespace
const size_t SectionContentBeginOffset =
Header.e_ehsize + Header.e_shentsize * Header.e_shnum;
ContiguousBlobAccumulator CBA(SectionContentBeginOffset);
- ELFState<ELFT> State(Header, CBA, DotStrtabSecNo);
-
SectionNameToIdxMap SN2I;
for (unsigned i = 0, e = Sections.size(); i != e; ++i) {
StringRef Name = Sections[i].Name;
}
}
+ ELFState<ELFT> State(Header, CBA, DotStrtabSecNo, SN2I);
+
StringTableBuilder SHStrTab;
std::vector<Elf_Shdr> SHeaders;
{