Lines Matching refs:Doc
204 ELFYAML::Object &Doc; member in __anone0ba05900111::ELFState
324 static bool writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
341 : Doc(D), ErrHandler(EH) { in ELFState()
345 if (Doc.Header.SectionHeaderStringTable) { in ELFState()
346 SectionHeaderStringTableName = *Doc.Header.SectionHeaderStringTable; in ELFState()
347 if (*Doc.Header.SectionHeaderStringTable == ".strtab") in ELFState()
349 else if (*Doc.Header.SectionHeaderStringTable == ".dynstr") in ELFState()
354 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in ELFState()
357 Doc.Chunks.insert( in ELFState()
358 Doc.Chunks.begin(), in ELFState()
364 for (size_t I = 0; I < Doc.Chunks.size(); ++I) { in ELFState()
365 const std::unique_ptr<ELFYAML::Chunk> &C = Doc.Chunks[I]; in ELFState()
391 if (Doc.DynamicSymbols) { in ELFState()
398 if (Doc.Symbols) { in ELFState()
404 if (Doc.DWARF) in ELFState()
405 for (StringRef DebugSecName : Doc.DWARF->getNonEmptySectionNames()) { in ELFState()
444 if (Doc.Chunks.back().get() == SecHdrTable) in ELFState()
445 Doc.Chunks.insert(Doc.Chunks.end() - 1, std::move(Sec)); in ELFState()
447 Doc.Chunks.push_back(std::move(Sec)); in ELFState()
453 Doc.Chunks.push_back( in ELFState()
468 Header.e_ident[EI_DATA] = Doc.Header.Data; in writeELFHeader()
470 Header.e_ident[EI_OSABI] = Doc.Header.OSABI; in writeELFHeader()
471 Header.e_ident[EI_ABIVERSION] = Doc.Header.ABIVersion; in writeELFHeader()
472 Header.e_type = Doc.Header.Type; in writeELFHeader()
474 if (Doc.Header.Machine) in writeELFHeader()
475 Header.e_machine = *Doc.Header.Machine; in writeELFHeader()
480 Header.e_entry = Doc.Header.Entry; in writeELFHeader()
481 Header.e_flags = Doc.Header.Flags; in writeELFHeader()
484 if (Doc.Header.EPhOff) in writeELFHeader()
485 Header.e_phoff = *Doc.Header.EPhOff; in writeELFHeader()
486 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
491 if (Doc.Header.EPhEntSize) in writeELFHeader()
492 Header.e_phentsize = *Doc.Header.EPhEntSize; in writeELFHeader()
493 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
498 if (Doc.Header.EPhNum) in writeELFHeader()
499 Header.e_phnum = *Doc.Header.EPhNum; in writeELFHeader()
500 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
501 Header.e_phnum = Doc.ProgramHeaders.size(); in writeELFHeader()
505 Header.e_shentsize = Doc.Header.EShEntSize ? (uint16_t)*Doc.Header.EShEntSize in writeELFHeader()
509 Doc.getSectionHeaderTable(); in writeELFHeader()
511 if (Doc.Header.EShOff) in writeELFHeader()
512 Header.e_shoff = *Doc.Header.EShOff; in writeELFHeader()
518 if (Doc.Header.EShNum) in writeELFHeader()
519 Header.e_shnum = *Doc.Header.EShNum; in writeELFHeader()
521 Header.e_shnum = SectionHeaders.getNumHeaders(Doc.getSections().size()); in writeELFHeader()
523 if (Doc.Header.EShStrNdx) in writeELFHeader()
524 Header.e_shstrndx = *Doc.Header.EShStrNdx; in writeELFHeader()
538 for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) { in initProgramHeaders()
539 if (auto S = dyn_cast<ELFYAML::Fill>(Doc.Chunks[I].get())) in initProgramHeaders()
541 NameToIndex[Doc.Chunks[I]->Name] = I + 1; in initProgramHeaders()
544 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in initProgramHeaders()
545 for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) { in initProgramHeaders()
546 ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I]; in initProgramHeaders()
578 YamlPhdr.Chunks.push_back(Doc.Chunks[I - 1].get()); in initProgramHeaders()
599 Doc.getSectionHeaderTable(); in toSectionIndex()
763 SHeaders.resize(Doc.getSections().size()); in initSectionHeaders()
765 for (const std::unique_ptr<ELFYAML::Chunk> &D : Doc.Chunks) { in initSectionHeaders()
793 bool IsFirstUndefSection = Sec == Doc.getSections().front(); in initSectionHeaders()
812 Doc.Header.Machine.value_or(ELF::EM_NONE), Sec->Type, Sec->Name); in initSectionHeaders()
921 if (Doc.Header.Type.value == ELF::ET_REL || in assignSectionAddress()
978 if (IsStatic && Doc.Symbols) in initSymtabSectionHeader()
979 Symbols = *Doc.Symbols; in initSymtabSectionHeader()
980 else if (!IsStatic && Doc.DynamicSymbols) in initSymtabSectionHeader()
981 Symbols = *Doc.DynamicSymbols; in initSymtabSectionHeader()
987 (IsStatic && Doc.Symbols) || (!IsStatic && Doc.DynamicSymbols); in initSymtabSectionHeader()
1106 if (Doc.DWARF && shouldEmitDWARF(*Doc.DWARF, Name)) { in initDWARFSectionHeader()
1113 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1169 for (auto &YamlPhdr : Doc.ProgramHeaders) { in setProgramHeaderLayout()
1249 if (shouldAllocateFileSpace(Doc.ProgramHeaders, S)) in writeSectionContent()
1291 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
1297 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
1841 Doc.getSectionHeaderTable(); in buildSectionHeaderReorderMap()
1865 for (const ELFYAML::Section *S : Doc.getSections()) { in buildSectionHeaderReorderMap()
1867 if (S == Doc.getSections().front()) in buildSectionHeaderReorderMap()
1890 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in buildSectionIndex()
1892 Doc.getSectionHeaderTable(); in buildSectionIndex()
1925 if (Doc.Symbols) in buildSymbolIndexes()
1926 Build(*Doc.Symbols, SymN2I); in buildSymbolIndexes()
1927 if (Doc.DynamicSymbols) in buildSymbolIndexes()
1928 Build(*Doc.DynamicSymbols, DynSymN2I); in buildSymbolIndexes()
1933 if (Doc.Symbols) in finalizeStrings()
1934 for (const ELFYAML::Symbol &Sym : *Doc.Symbols) in finalizeStrings()
1939 if (Doc.DynamicSymbols) in finalizeStrings()
1940 for (const ELFYAML::Symbol &Sym : *Doc.DynamicSymbols) in finalizeStrings()
1945 for (const ELFYAML::Chunk *Sec : Doc.getSections()) { in finalizeStrings()
1971 bool ELFState<ELFT>::writeELF(raw_ostream &OS, ELFYAML::Object &Doc, in writeELF() argument
1973 ELFState<ELFT> State(Doc, EH); in writeELF()
1996 sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size(); in writeELF()
2027 const ELFYAML::SectionHeaderTable &SHT = Doc.getSectionHeaderTable(); in writeELF()
2039 bool yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, in yaml2elf() argument
2041 bool IsLE = Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in yaml2elf()
2042 bool Is64Bit = Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64); in yaml2elf()
2045 return ELFState<object::ELF64LE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
2046 return ELFState<object::ELF64BE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
2049 return ELFState<object::ELF32LE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
2050 return ELFState<object::ELF32BE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()