Lines Matching full:doc

207   ELFYAML::Object &Doc;
327 static bool writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
344 : Doc(D), ErrHandler(EH) {
348 if (Doc.Header.SectionHeaderStringTable) {
349 SectionHeaderStringTableName = *Doc.Header.SectionHeaderStringTable;
350 if (*Doc.Header.SectionHeaderStringTable == ".strtab")
352 else if (*Doc.Header.SectionHeaderStringTable == ".dynstr")
357 std::vector<ELFYAML::Section *> Sections = Doc.getSections();
360 Doc.Chunks.insert(
361 Doc.Chunks.begin(),
367 for (size_t I = 0; I < Doc.Chunks.size(); ++I) {
368 const std::unique_ptr<ELFYAML::Chunk> &C = Doc.Chunks[I];
394 if (Doc.DynamicSymbols) {
401 if (Doc.Symbols) {
407 if (Doc.DWARF)
408 for (StringRef DebugSecName : Doc.DWARF->getNonEmptySectionNames()) {
447 if (Doc.Chunks.back().get() == SecHdrTable)
448 Doc.Chunks.insert(Doc.Chunks.end() - 1, std::move(Sec));
450 Doc.Chunks.push_back(std::move(Sec));
456 Doc.Chunks.push_back(
471 Header.e_ident[EI_DATA] = Doc.Header.Data;
473 Header.e_ident[EI_OSABI] = Doc.Header.OSABI;
474 Header.e_ident[EI_ABIVERSION] = Doc.Header.ABIVersion;
475 Header.e_type = Doc.Header.Type;
477 if (Doc.Header.Machine)
478 Header.e_machine = *Doc.Header.Machine;
483 Header.e_entry = Doc.Header.Entry;
484 Header.e_flags = Doc.Header.Flags;
487 if (Doc.Header.EPhOff)
488 Header.e_phoff = *Doc.Header.EPhOff;
489 else if (!Doc.ProgramHeaders.empty())
494 if (Doc.Header.EPhEntSize)
495 Header.e_phentsize = *Doc.Header.EPhEntSize;
496 else if (!Doc.ProgramHeaders.empty())
501 if (Doc.Header.EPhNum)
502 Header.e_phnum = *Doc.Header.EPhNum;
503 else if (!Doc.ProgramHeaders.empty())
504 Header.e_phnum = Doc.ProgramHeaders.size();
508 Header.e_shentsize = Doc.Header.EShEntSize ? (uint16_t)*Doc.Header.EShEntSize
512 Doc.getSectionHeaderTable();
514 if (Doc.Header.EShOff)
515 Header.e_shoff = *Doc.Header.EShOff;
521 if (Doc.Header.EShNum)
522 Header.e_shnum = *Doc.Header.EShNum;
524 Header.e_shnum = SectionHeaders.getNumHeaders(Doc.getSections().size());
526 if (Doc.Header.EShStrNdx)
527 Header.e_shstrndx = *Doc.Header.EShStrNdx;
540 for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) {
541 NameToIndex[Doc.Chunks[I]->Name] = I + 1;
544 for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) {
545 ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I];
577 YamlPhdr.Chunks.push_back(Doc.Chunks[I - 1].get());
598 Doc.getSectionHeaderTable();
762 SHeaders.resize(Doc.getSections().size());
764 for (const std::unique_ptr<ELFYAML::Chunk> &D : Doc.Chunks) {
792 bool IsFirstUndefSection = Sec == Doc.getSections().front();
811 Doc.Header.Machine.value_or(ELF::EM_NONE), Sec->Type, Sec->Name);
920 if (Doc.Header.Type.value == ELF::ET_REL ||
977 if (IsStatic && Doc.Symbols)
978 Symbols = *Doc.Symbols;
979 else if (!IsStatic && Doc.DynamicSymbols)
980 Symbols = *Doc.DynamicSymbols;
986 (IsStatic && Doc.Symbols) || (!IsStatic && Doc.DynamicSymbols);
1105 if (Doc.DWARF && shouldEmitDWARF(*Doc.DWARF, Name)) {
1112 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA))
1168 for (auto &YamlPhdr : Doc.ProgramHeaders) {
1248 if (shouldAllocateFileSpace(Doc.ProgramHeaders, S))
1333 REntry.setSymbolAndType(CurSymIdx, Rel.Type, isMips64EL(Doc));
1339 REntry.setSymbolAndType(CurSymIdx, Rel.Type, isMips64EL(Doc));
1925 Doc.getSectionHeaderTable();
1949 for (const ELFYAML::Section *S : Doc.getSections()) {
1951 if (S == Doc.getSections().front())
1974 std::vector<ELFYAML::Section *> Sections = Doc.getSections();
1976 Doc.getSectionHeaderTable();
2009 if (Doc.Symbols)
2010 Build(*Doc.Symbols, SymN2I);
2011 if (Doc.DynamicSymbols)
2012 Build(*Doc.DynamicSymbols, DynSymN2I);
2017 if (Doc.Symbols)
2018 for (const ELFYAML::Symbol &Sym : *Doc.Symbols)
2023 if (Doc.DynamicSymbols)
2024 for (const ELFYAML::Symbol &Sym : *Doc.DynamicSymbols)
2029 for (const ELFYAML::Chunk *Sec : Doc.getSections()) {
2055 bool ELFState<ELFT>::writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
2057 ELFState<ELFT> State(Doc, EH);
2080 sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size();
2111 const ELFYAML::SectionHeaderTable &SHT = Doc.getSectionHeaderTable();
2123 bool yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH,
2125 bool IsLE = Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB);
2126 bool Is64Bit = Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64);
2129 return ELFState<object::ELF64LE>::writeELF(Out, Doc, EH, MaxSize);
2130 return ELFState<object::ELF64BE>::writeELF(Out, Doc, EH, MaxSize);
2133 return ELFState<object::ELF32LE>::writeELF(Out, Doc, EH, MaxSize);
2134 return ELFState<object::ELF32BE>::writeELF(Out, Doc, EH, MaxSize);