Lines Matching refs:Doc

192   ELFYAML::Object &Doc;
312 static bool writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
329 : Doc(D), ErrHandler(EH) {
330 std::vector<ELFYAML::Section *> Sections = Doc.getSections();
333 Doc.Chunks.insert(
334 Doc.Chunks.begin(),
340 for (size_t I = 0; I < Doc.Chunks.size(); ++I) {
341 const std::unique_ptr<ELFYAML::Chunk> &C = Doc.Chunks[I];
367 if (Doc.DynamicSymbols)
369 if (Doc.Symbols)
371 if (Doc.DWARF)
372 for (StringRef DebugSecName : Doc.DWARF->getNonEmptySectionNames()) {
402 if (Doc.Chunks.back().get() == SecHdrTable)
403 Doc.Chunks.insert(Doc.Chunks.end() - 1, std::move(Sec));
405 Doc.Chunks.push_back(std::move(Sec));
411 Doc.Chunks.push_back(
426 Header.e_ident[EI_DATA] = Doc.Header.Data;
428 Header.e_ident[EI_OSABI] = Doc.Header.OSABI;
429 Header.e_ident[EI_ABIVERSION] = Doc.Header.ABIVersion;
430 Header.e_type = Doc.Header.Type;
432 if (Doc.Header.Machine)
433 Header.e_machine = *Doc.Header.Machine;
438 Header.e_entry = Doc.Header.Entry;
439 Header.e_flags = Doc.Header.Flags;
442 if (Doc.Header.EPhOff)
443 Header.e_phoff = *Doc.Header.EPhOff;
444 else if (!Doc.ProgramHeaders.empty())
449 if (Doc.Header.EPhEntSize)
450 Header.e_phentsize = *Doc.Header.EPhEntSize;
451 else if (!Doc.ProgramHeaders.empty())
456 if (Doc.Header.EPhNum)
457 Header.e_phnum = *Doc.Header.EPhNum;
458 else if (!Doc.ProgramHeaders.empty())
459 Header.e_phnum = Doc.ProgramHeaders.size();
463 Header.e_shentsize = Doc.Header.EShEntSize ? (uint16_t)*Doc.Header.EShEntSize
467 Doc.getSectionHeaderTable();
469 if (Doc.Header.EShOff)
470 Header.e_shoff = *Doc.Header.EShOff;
476 if (Doc.Header.EShNum)
477 Header.e_shnum = *Doc.Header.EShNum;
479 Header.e_shnum = SectionHeaders.getNumHeaders(Doc.getSections().size());
481 if (Doc.Header.EShStrNdx)
482 Header.e_shstrndx = *Doc.Header.EShStrNdx;
495 for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) {
496 if (auto S = dyn_cast<ELFYAML::Fill>(Doc.Chunks[I].get()))
498 NameToIndex[Doc.Chunks[I]->Name] = I + 1;
501 std::vector<ELFYAML::Section *> Sections = Doc.getSections();
502 for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) {
503 ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I];
535 YamlPhdr.Chunks.push_back(Doc.Chunks[I - 1].get());
556 Doc.getSectionHeaderTable();
721 SHeaders.resize(Doc.getSections().size());
723 for (const std::unique_ptr<ELFYAML::Chunk> &D : Doc.Chunks) {
751 bool IsFirstUndefSection = Sec == Doc.getSections().front();
770 Doc.Header.Machine.getValueOr(ELF::EM_NONE), Sec->Type, Sec->Name);
879 if (Doc.Header.Type.value == ELF::ET_REL ||
936 if (IsStatic && Doc.Symbols)
937 Symbols = *Doc.Symbols;
938 else if (!IsStatic && Doc.DynamicSymbols)
939 Symbols = *Doc.DynamicSymbols;
945 (IsStatic && Doc.Symbols) || (!IsStatic && Doc.DynamicSymbols);
1064 if (Doc.DWARF && shouldEmitDWARF(*Doc.DWARF, Name)) {
1071 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA))
1127 for (auto &YamlPhdr : Doc.ProgramHeaders) {
1207 if (shouldAllocateFileSpace(Doc.ProgramHeaders, S))
1249 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc));
1255 REntry.setSymbolAndType(SymIdx, Rel.Type, isMips64EL(Doc));
1749 Doc.getSectionHeaderTable();
1773 for (const ELFYAML::Section *S : Doc.getSections()) {
1775 if (S == Doc.getSections().front())
1798 std::vector<ELFYAML::Section *> Sections = Doc.getSections();
1800 Doc.getSectionHeaderTable();
1835 if (Doc.Symbols)
1836 Build(*Doc.Symbols, SymN2I);
1837 if (Doc.DynamicSymbols)
1838 Build(*Doc.DynamicSymbols, DynSymN2I);
1843 if (Doc.Symbols)
1844 for (const ELFYAML::Symbol &Sym : *Doc.Symbols)
1849 if (Doc.DynamicSymbols)
1850 for (const ELFYAML::Symbol &Sym : *Doc.DynamicSymbols)
1855 for (const ELFYAML::Chunk *Sec : Doc.getSections()) {
1876 bool ELFState<ELFT>::writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
1878 ELFState<ELFT> State(Doc, EH);
1899 sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size();
1930 const ELFYAML::SectionHeaderTable &SHT = Doc.getSectionHeaderTable();
1942 bool yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH,
1944 bool IsLE = Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB);
1945 bool Is64Bit = Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64);
1948 return ELFState<object::ELF64LE>::writeELF(Out, Doc, EH, MaxSize);
1949 return ELFState<object::ELF64BE>::writeELF(Out, Doc, EH, MaxSize);
1952 return ELFState<object::ELF32LE>::writeELF(Out, Doc, EH, MaxSize);
1953 return ELFState<object::ELF32BE>::writeELF(Out, Doc, EH, MaxSize);