• Home
  • Raw
  • Download

Lines Matching refs:Doc

195   ELFYAML::Object &Doc;  member in __anonbe606ff10111::ELFState
315 static bool writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
332 : Doc(D), ErrHandler(EH) { in ELFState()
333 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in ELFState()
336 Doc.Chunks.insert( in ELFState()
337 Doc.Chunks.begin(), in ELFState()
345 for (size_t I = 0; I < Doc.Chunks.size(); ++I) { in ELFState()
346 const std::unique_ptr<ELFYAML::Chunk> &C = Doc.Chunks[I]; in ELFState()
360 if (Doc.DynamicSymbols) in ELFState()
362 if (Doc.Symbols) in ELFState()
364 if (Doc.DWARF) in ELFState()
365 for (StringRef DebugSecName : Doc.DWARF->getNonEmptySectionNames()) { in ELFState()
370 if (!Doc.SectionHeaders || !Doc.SectionHeaders->NoHeaders.getValueOr(false)) in ELFState()
382 Doc.Chunks.push_back(std::move(Sec)); in ELFState()
397 Header.e_ident[EI_DATA] = Doc.Header.Data; in writeELFHeader()
399 Header.e_ident[EI_OSABI] = Doc.Header.OSABI; in writeELFHeader()
400 Header.e_ident[EI_ABIVERSION] = Doc.Header.ABIVersion; in writeELFHeader()
401 Header.e_type = Doc.Header.Type; in writeELFHeader()
403 if (Doc.Header.Machine) in writeELFHeader()
404 Header.e_machine = *Doc.Header.Machine; in writeELFHeader()
409 Header.e_entry = Doc.Header.Entry; in writeELFHeader()
410 Header.e_flags = Doc.Header.Flags; in writeELFHeader()
413 if (Doc.Header.EPhOff) in writeELFHeader()
414 Header.e_phoff = *Doc.Header.EPhOff; in writeELFHeader()
415 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
420 if (Doc.Header.EPhEntSize) in writeELFHeader()
421 Header.e_phentsize = *Doc.Header.EPhEntSize; in writeELFHeader()
422 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
427 if (Doc.Header.EPhNum) in writeELFHeader()
428 Header.e_phnum = *Doc.Header.EPhNum; in writeELFHeader()
429 else if (!Doc.ProgramHeaders.empty()) in writeELFHeader()
430 Header.e_phnum = Doc.ProgramHeaders.size(); in writeELFHeader()
434 Header.e_shentsize = Doc.Header.EShEntSize ? (uint16_t)*Doc.Header.EShEntSize in writeELFHeader()
437 if (Doc.Header.EShOff) in writeELFHeader()
438 Header.e_shoff = *Doc.Header.EShOff; in writeELFHeader()
444 if (Doc.Header.EShNum) in writeELFHeader()
445 Header.e_shnum = *Doc.Header.EShNum; in writeELFHeader()
446 else if (!Doc.SectionHeaders || in writeELFHeader()
447 (Doc.SectionHeaders->NoHeaders && !*Doc.SectionHeaders->NoHeaders)) in writeELFHeader()
448 Header.e_shnum = Doc.getSections().size(); in writeELFHeader()
453 (Doc.SectionHeaders->Sections ? Doc.SectionHeaders->Sections->size() in writeELFHeader()
457 if (Doc.Header.EShStrNdx) in writeELFHeader()
458 Header.e_shstrndx = *Doc.Header.EShStrNdx; in writeELFHeader()
471 for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) { in initProgramHeaders()
472 if (auto S = dyn_cast<ELFYAML::Fill>(Doc.Chunks[I].get())) in initProgramHeaders()
474 NameToIndex[Doc.Chunks[I]->Name] = I + 1; in initProgramHeaders()
477 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in initProgramHeaders()
478 for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) { in initProgramHeaders()
479 ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I]; in initProgramHeaders()
511 YamlPhdr.Chunks.push_back(Doc.Chunks[I - 1].get()); in initProgramHeaders()
531 if (!Doc.SectionHeaders || (Doc.SectionHeaders->NoHeaders && in toSectionIndex()
532 !Doc.SectionHeaders->NoHeaders.getValue())) in toSectionIndex()
535 assert(!Doc.SectionHeaders->NoHeaders.getValueOr(false) || in toSectionIndex()
536 !Doc.SectionHeaders->Sections); in toSectionIndex()
538 Doc.SectionHeaders->Sections ? Doc.SectionHeaders->Sections->size() : 0; in toSectionIndex()
671 SHeaders.resize(Doc.getSections().size()); in initSectionHeaders()
673 for (const std::unique_ptr<ELFYAML::Chunk> &D : Doc.Chunks) { in initSectionHeaders()
682 bool IsFirstUndefSection = D == Doc.Chunks.front(); in initSectionHeaders()
799 if (Doc.Header.Type.value == ELF::ET_REL || in assignSectionAddress()
856 if (IsStatic && Doc.Symbols) in initSymtabSectionHeader()
857 Symbols = *Doc.Symbols; in initSymtabSectionHeader()
858 else if (!IsStatic && Doc.DynamicSymbols) in initSymtabSectionHeader()
859 Symbols = *Doc.DynamicSymbols; in initSymtabSectionHeader()
865 (IsStatic && Doc.Symbols) || (!IsStatic && Doc.DynamicSymbols); in initSymtabSectionHeader()
1013 if (Doc.DWARF && shouldEmitDWARF(*Doc.DWARF, Name)) { in initDWARFSectionHeader()
1020 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1084 for (auto &YamlPhdr : Doc.ProgramHeaders) { in setProgramHeaderLayout()
1164 if (shouldAllocateFileSpace(Doc.ProgramHeaders, S)) in writeSectionContent()
1220 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
1226 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc)); in writeSectionContent()
1766 if (!Doc.SectionHeaders || Doc.SectionHeaders->NoHeaders) in buildSectionHeaderReorderMap()
1780 if (Doc.SectionHeaders->Sections) in buildSectionHeaderReorderMap()
1781 for (const ELFYAML::SectionHeader &Hdr : *Doc.SectionHeaders->Sections) in buildSectionHeaderReorderMap()
1784 if (Doc.SectionHeaders->Excluded) in buildSectionHeaderReorderMap()
1785 for (const ELFYAML::SectionHeader &Hdr : *Doc.SectionHeaders->Excluded) in buildSectionHeaderReorderMap()
1788 for (const ELFYAML::Section *S : Doc.getSections()) { in buildSectionHeaderReorderMap()
1790 if (S == Doc.getSections().front()) in buildSectionHeaderReorderMap()
1813 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in buildSectionIndex()
1814 if (Doc.SectionHeaders) { in buildSectionIndex()
1815 if (Doc.SectionHeaders->Excluded) in buildSectionIndex()
1816 for (const ELFYAML::SectionHeader &Hdr : *Doc.SectionHeaders->Excluded) in buildSectionIndex()
1820 if (Doc.SectionHeaders->NoHeaders.getValueOr(false)) in buildSectionIndex()
1850 if (Doc.Symbols) in buildSymbolIndexes()
1851 Build(*Doc.Symbols, SymN2I); in buildSymbolIndexes()
1852 if (Doc.DynamicSymbols) in buildSymbolIndexes()
1853 Build(*Doc.DynamicSymbols, DynSymN2I); in buildSymbolIndexes()
1858 if (Doc.Symbols) in finalizeStrings()
1859 for (const ELFYAML::Symbol &Sym : *Doc.Symbols) in finalizeStrings()
1864 if (Doc.DynamicSymbols) in finalizeStrings()
1865 for (const ELFYAML::Symbol &Sym : *Doc.DynamicSymbols) in finalizeStrings()
1870 for (const ELFYAML::Chunk *Sec : Doc.getSections()) { in finalizeStrings()
1891 bool ELFState<ELFT>::writeELF(raw_ostream &OS, ELFYAML::Object &Doc, in writeELF() argument
1893 ELFState<ELFT> State(Doc, EH); in writeELF()
1914 sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size(); in writeELF()
1930 !Doc.SectionHeaders || !Doc.SectionHeaders->NoHeaders.getValueOr(false); in writeELF()
1963 bool yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, in yaml2elf() argument
1965 bool IsLE = Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in yaml2elf()
1966 bool Is64Bit = Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64); in yaml2elf()
1969 return ELFState<object::ELF64LE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
1970 return ELFState<object::ELF64BE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
1973 return ELFState<object::ELF32LE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()
1974 return ELFState<object::ELF32BE>::writeELF(Out, Doc, EH, MaxSize); in yaml2elf()