Lines Matching refs:Doc
115 const ELFYAML::Object &Doc; member in __anon210407000311::ELFState
146 unsigned getDotSymTabSecNo() const { return Doc.Sections.size() + 1; } in getDotSymTabSecNo()
147 unsigned getDotStrTabSecNo() const { return Doc.Sections.size() + 2; } in getDotStrTabSecNo()
148 unsigned getDotShStrTabSecNo() const { return Doc.Sections.size() + 3; } in getDotShStrTabSecNo()
149 unsigned getSectionCount() const { return Doc.Sections.size() + 4; } in getSectionCount()
151 ELFState(const ELFYAML::Object &D) : Doc(D) {} in ELFState()
154 static int writeELF(raw_ostream &OS, const ELFYAML::Object &Doc);
170 Header.e_ident[EI_OSABI] = Doc.Header.OSABI; in initELFHeader()
172 Header.e_type = Doc.Header.Type; in initELFHeader()
173 Header.e_machine = Doc.Header.Machine; in initELFHeader()
175 Header.e_entry = Doc.Header.Entry; in initELFHeader()
176 Header.e_flags = Doc.Header.Flags; in initELFHeader()
194 for (const auto &Sec : Doc.Sections) in initSectionHeaders()
198 for (const auto &Sec : Doc.Sections) { in initSectionHeaders()
270 SHeader.sh_info = Doc.Symbols.Local.size() + 1; in initSymtabSectionHeader()
283 for (const auto &Sym : Doc.Symbols.Local) in initSymtabSectionHeader()
285 for (const auto &Sym : Doc.Symbols.Global) in initSymtabSectionHeader()
287 for (const auto &Sym : Doc.Symbols.Weak) in initSymtabSectionHeader()
291 addSymbols(Doc.Symbols.Local, Syms, ELF::STB_LOCAL); in initSymtabSectionHeader()
292 addSymbols(Doc.Symbols.Global, Syms, ELF::STB_GLOBAL); in initSymtabSectionHeader()
293 addSymbols(Doc.Symbols.Weak, Syms, ELF::STB_WEAK); in initSymtabSectionHeader()
356 static bool isMips64EL(const ELFYAML::Object &Doc) { in isMips64EL() argument
357 return Doc.Header.Machine == ELFYAML::ELF_EM(llvm::ELF::EM_MIPS) && in isMips64EL()
358 Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64) && in isMips64EL()
359 Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in isMips64EL()
389 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
395 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
466 for (unsigned i = 0, e = Doc.Sections.size(); i != e; ++i) { in buildSectionIndex()
467 StringRef Name = Doc.Sections[i]->Name; in buildSectionIndex()
497 int ELFState<ELFT>::writeELF(raw_ostream &OS, const ELFYAML::Object &Doc) { in writeELF() argument
498 ELFState<ELFT> State(Doc); in writeELF()
503 if (!State.buildSymbolIndex(StartSymIndex, Doc.Symbols.Local) || in writeELF()
504 !State.buildSymbolIndex(StartSymIndex, Doc.Symbols.Global) || in writeELF()
505 !State.buildSymbolIndex(StartSymIndex, Doc.Symbols.Weak)) in writeELF()
553 static bool is64Bit(const ELFYAML::Object &Doc) { in is64Bit() argument
554 return Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64); in is64Bit()
557 static bool isLittleEndian(const ELFYAML::Object &Doc) { in isLittleEndian() argument
558 return Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in isLittleEndian()
561 int yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out) { in yaml2elf() argument
567 if (is64Bit(Doc)) { in yaml2elf()
568 if (isLittleEndian(Doc)) in yaml2elf()
569 return ELFState<LE64>::writeELF(Out, Doc); in yaml2elf()
571 return ELFState<BE64>::writeELF(Out, Doc); in yaml2elf()
573 if (isLittleEndian(Doc)) in yaml2elf()
574 return ELFState<LE32>::writeELF(Out, Doc); in yaml2elf()
576 return ELFState<BE32>::writeELF(Out, Doc); in yaml2elf()