Lines Matching refs:Doc

202   ELFYAML::Object &Doc;  member in __anon2264ce4a0111::ELFState
322 static bool writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
339 : Doc(D), ErrHandler(EH) { in ELFState()
343 if (Doc.Header.SectionHeaderStringTable) { in ELFState()
344 SectionHeaderStringTableName = *Doc.Header.SectionHeaderStringTable; in ELFState()
345 if (*Doc.Header.SectionHeaderStringTable == ".strtab") in ELFState()
347 else if (*Doc.Header.SectionHeaderStringTable == ".dynstr") in ELFState()
352 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in ELFState()
355 Doc.Chunks.insert( in ELFState()
356 Doc.Chunks.begin(), in ELFState()
362 for (size_t I = 0; I < Doc.Chunks.size(); ++I) { in ELFState()
363 const std::unique_ptr<ELFYAML::Chunk> &C = Doc.Chunks[I]; in ELFState()
389 if (Doc.DynamicSymbols) { in ELFState()
396 if (Doc.Symbols) { in ELFState()
402 if (Doc.DWARF) in ELFState()
403 for (StringRef DebugSecName : Doc.DWARF->getNonEmptySectionNames()) { in ELFState()
442 if (Doc.Chunks.back().get() == SecHdrTable) in ELFState()
443 Doc.Chunks.insert(Doc.Chunks.end() - 1, std::move(Sec)); in ELFState()
445 Doc.Chunks.push_back(std::move(Sec)); in ELFState()
451 Doc.Chunks.push_back( in ELFState()
466 Header.e_ident[EI_DATA] = Doc.Header.Data; in writeELFHeader()
468 Header.e_ident[EI_OSABI] = Doc.Header.OSABI; in writeELFHeader()
469 Header.e_ident[EI_ABIVERSION] = Doc.Header.ABIVersion; in writeELFHeader()
470 Header.e_type = Doc.Header.Type; in writeELFHeader()
472 if (Doc.Header.Machine) in writeELFHeader()
473 Header.e_machine = *Doc.Header.Machine; in writeELFHeader()
478 Header.e_entry = Doc.Header.Entry; in writeELFHeader()
479 Header.e_flags = Doc.Header.Flags; in writeELFHeader()
482 if (Doc.Header.EPhOff) in writeELFHeader()
483 Header.e_phoff = *Doc.Header.EPhOff; in writeELFHeader()
484 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
489 if (Doc.Header.EPhEntSize) in writeELFHeader()
490 Header.e_phentsize = *Doc.Header.EPhEntSize; in writeELFHeader()
491 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
496 if (Doc.Header.EPhNum) in writeELFHeader()
497 Header.e_phnum = *Doc.Header.EPhNum; in writeELFHeader()
498 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
499 Header.e_phnum = Doc.ProgramHeaders.size(); in writeELFHeader()
503 Header.e_shentsize = Doc.Header.EShEntSize ? (uint16_t)*Doc.Header.EShEntSize in writeELFHeader()
507 Doc.getSectionHeaderTable(); in writeELFHeader()
509 if (Doc.Header.EShOff) in writeELFHeader()
510 Header.e_shoff = *Doc.Header.EShOff; in writeELFHeader()
516 if (Doc.Header.EShNum) in writeELFHeader()
517 Header.e_shnum = *Doc.Header.EShNum; in writeELFHeader()
519 Header.e_shnum = SectionHeaders.getNumHeaders(Doc.getSections().size()); in writeELFHeader()
521 if (Doc.Header.EShStrNdx) in writeELFHeader()
522 Header.e_shstrndx = *Doc.Header.EShStrNdx; in writeELFHeader()
536 for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) { in initProgramHeaders()
537 if (auto S = dyn_cast<ELFYAML::Fill>(Doc.Chunks[I].get())) in initProgramHeaders()
539 NameToIndex[Doc.Chunks[I]->Name] = I + 1; in initProgramHeaders()
542 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in initProgramHeaders()
543 for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) { in initProgramHeaders()
544 ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I]; in initProgramHeaders()
576 YamlPhdr.Chunks.push_back(Doc.Chunks[I - 1].get()); in initProgramHeaders()
597 Doc.getSectionHeaderTable(); in toSectionIndex()
761 SHeaders.resize(Doc.getSections().size()); in initSectionHeaders()
763 for (const std::unique_ptr<ELFYAML::Chunk> &D : Doc.Chunks) { in initSectionHeaders()
791 bool IsFirstUndefSection = Sec == Doc.getSections().front(); in initSectionHeaders()
810 Doc.Header.Machine.value_or(ELF::EM_NONE), Sec->Type, Sec->Name); in initSectionHeaders()
919 if (Doc.Header.Type.value == ELF::ET_REL || in assignSectionAddress()
976 if (IsStatic && Doc.Symbols) in initSymtabSectionHeader()
977 Symbols = *Doc.Symbols; in initSymtabSectionHeader()
978 else if (!IsStatic && Doc.DynamicSymbols) in initSymtabSectionHeader()
979 Symbols = *Doc.DynamicSymbols; in initSymtabSectionHeader()
985 (IsStatic && Doc.Symbols) || (!IsStatic && Doc.DynamicSymbols); in initSymtabSectionHeader()
1104 if (Doc.DWARF && shouldEmitDWARF(*Doc.DWARF, Name)) { in initDWARFSectionHeader()
1111 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1167 for (auto &YamlPhdr : Doc.ProgramHeaders) { in setProgramHeaderLayout()
1247 if (shouldAllocateFileSpace(Doc.ProgramHeaders, S)) in writeSectionContent()
1289 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
1295 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
1785 Doc.getSectionHeaderTable(); in buildSectionHeaderReorderMap()
1809 for (const ELFYAML::Section *S : Doc.getSections()) { in buildSectionHeaderReorderMap()
1811 if (S == Doc.getSections().front()) in buildSectionHeaderReorderMap()
1834 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in buildSectionIndex()
1836 Doc.getSectionHeaderTable(); in buildSectionIndex()
1869 if (Doc.Symbols) in buildSymbolIndexes()
1870 Build(*Doc.Symbols, SymN2I); in buildSymbolIndexes()
1871 if (Doc.DynamicSymbols) in buildSymbolIndexes()
1872 Build(*Doc.DynamicSymbols, DynSymN2I); in buildSymbolIndexes()
1877 if (Doc.Symbols) in finalizeStrings()
1878 for (const ELFYAML::Symbol &Sym : *Doc.Symbols) in finalizeStrings()
1883 if (Doc.DynamicSymbols) in finalizeStrings()
1884 for (const ELFYAML::Symbol &Sym : *Doc.DynamicSymbols) in finalizeStrings()
1889 for (const ELFYAML::Chunk *Sec : Doc.getSections()) { in finalizeStrings()
1915 bool ELFState<ELFT>::writeELF(raw_ostream &OS, ELFYAML::Object &Doc, in writeELF() argument
1917 ELFState<ELFT> State(Doc, EH); in writeELF()
1940 sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size(); in writeELF()
1971 const ELFYAML::SectionHeaderTable &SHT = Doc.getSectionHeaderTable(); in writeELF()
1983 bool yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, in yaml2elf() argument
1985 bool IsLE = Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in yaml2elf()
1986 bool Is64Bit = Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64); in yaml2elf()
1989 return ELFState<object::ELF64LE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
1990 return ELFState<object::ELF64BE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
1993 return ELFState<object::ELF32LE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
1994 return ELFState<object::ELF32BE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()