Lines Matching full:io

47     IO &IO, ELFYAML::ELF_ET &Value) {
48 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
55 IO.enumFallback<Hex16>(Value);
59 IO &IO, ELFYAML::ELF_PT &Value) {
60 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
74 IO.enumFallback<Hex32>(Value);
78 IO &IO, ELFYAML::ELF_NT &Value) {
79 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
190 IO.enumFallback<Hex32>(Value);
194 IO &IO, ELFYAML::ELF_EM &Value) {
195 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
360 IO.enumFallback<Hex16>(Value);
364 IO &IO, ELFYAML::ELF_ELFCLASS &Value) {
365 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
374 IO &IO, ELFYAML::ELF_ELFDATA &Value) {
375 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
385 IO &IO, ELFYAML::ELF_ELFOSABI &Value) {
386 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
414 IO.enumFallback<Hex8>(Value);
417 void ScalarBitSetTraits<ELFYAML::ELF_EF>::bitset(IO &IO,
419 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
420 assert(Object && "The IO context is not initialized");
421 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
422 #define BCaseMask(X, M) IO.maskedBitSetCase(Value, #X, ELF::X, ELF::M)
634 IO.maskedBitSetCase(Value, Key.c_str(),
668 IO &IO, ELFYAML::ELF_SHT &Value) {
669 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
670 assert(Object && "The IO context is not initialized");
671 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
749 IO.enumFallback<Hex32>(Value);
752 void ScalarBitSetTraits<ELFYAML::ELF_PF>::bitset(IO &IO,
754 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
760 void ScalarBitSetTraits<ELFYAML::ELF_SHF>::bitset(IO &IO,
762 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
763 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
812 IO &IO, ELFYAML::ELF_SHN &Value) {
813 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
814 assert(Object && "The IO context is not initialized");
815 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
828 if (!IO.outputting() || Object->getMachine() == ELF::EM_MIPS) {
842 IO.enumFallback<Hex16>(Value);
846 IO &IO, ELFYAML::ELF_STB &Value) {
847 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
853 IO.enumFallback<Hex8>(Value);
857 IO &IO, ELFYAML::ELF_STT &Value) {
858 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
868 IO.enumFallback<Hex8>(Value);
873 IO &IO, ELFYAML::ELF_RSS &Value) {
874 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
883 IO &IO, ELFYAML::ELF_REL &Value) {
884 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
885 assert(Object && "The IO context is not initialized");
886 #define ELF_RELOC(X, Y) IO.enumCase(Value, #X, ELF::X);
948 IO.enumFallback<Hex32>(Value);
952 IO &IO, ELFYAML::ELF_DYNTAG &Value) {
953 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
954 assert(Object && "The IO context is not initialized");
966 #define DYNAMIC_TAG(X, Y) IO.enumCase(Value, STRINGIFY(DT_##X), ELF::DT_##X);
1023 IO.enumFallback<Hex64>(Value);
1027 IO &IO, ELFYAML::MIPS_AFL_REG &Value) {
1028 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
1037 IO &IO, ELFYAML::MIPS_ABI_FP &Value) {
1038 #define ECase(X) IO.enumCase(Value, #X, Mips::Val_GNU_MIPS_ABI_##X)
1051 IO &IO, ELFYAML::MIPS_AFL_EXT &Value) {
1052 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
1077 IO &IO, ELFYAML::MIPS_ISA &Value) {
1078 IO.enumCase(Value, "MIPS1", 1);
1079 IO.enumCase(Value, "MIPS2", 2);
1080 IO.enumCase(Value, "MIPS3", 3);
1081 IO.enumCase(Value, "MIPS4", 4);
1082 IO.enumCase(Value, "MIPS5", 5);
1083 IO.enumCase(Value, "MIPS32", 32);
1084 IO.enumCase(Value, "MIPS64", 64);
1085 IO.enumFallback<Hex32>(Value);
1089 IO &IO, ELFYAML::MIPS_AFL_ASE &Value) {
1090 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_ASE_##X)
1110 IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value) {
1111 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_FLAGS1_##X)
1117 IO &IO, ELFYAML::SectionHeader &SHdr) {
1118 IO.mapRequired("Name", SHdr.Name);
1121 void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO,
1123 IO.mapRequired("Class", FileHdr.Class);
1124 IO.mapRequired("Data", FileHdr.Data);
1125 IO.mapOptional("OSABI", FileHdr.OSABI, ELFYAML::ELF_ELFOSABI(0));
1126 IO.mapOptional("ABIVersion", FileHdr.ABIVersion, Hex8(0));
1127 IO.mapRequired("Type", FileHdr.Type);
1128 IO.mapOptional("Machine", FileHdr.Machine);
1129 IO.mapOptional("Flags", FileHdr.Flags, ELFYAML::ELF_EF(0));
1130 IO.mapOptional("Entry", FileHdr.Entry, Hex64(0));
1131 IO.mapOptional("SectionHeaderStringTable", FileHdr.SectionHeaderStringTable);
1134 assert(!IO.outputting() ||
1136 IO.mapOptional("EPhOff", FileHdr.EPhOff);
1137 IO.mapOptional("EPhEntSize", FileHdr.EPhEntSize);
1138 IO.mapOptional("EPhNum", FileHdr.EPhNum);
1139 IO.mapOptional("EShEntSize", FileHdr.EShEntSize);
1140 IO.mapOptional("EShOff", FileHdr.EShOff);
1141 IO.mapOptional("EShNum", FileHdr.EShNum);
1142 IO.mapOptional("EShStrNdx", FileHdr.EShStrNdx);
1146 IO &IO, ELFYAML::ProgramHeader &Phdr) {
1147 IO.mapRequired("Type", Phdr.Type);
1148 IO.mapOptional("Flags", Phdr.Flags, ELFYAML::ELF_PF(0));
1149 IO.mapOptional("FirstSec", Phdr.FirstSec);
1150 IO.mapOptional("LastSec", Phdr.LastSec);
1151 IO.mapOptional("VAddr", Phdr.VAddr, Hex64(0));
1152 IO.mapOptional("PAddr", Phdr.PAddr, Phdr.VAddr);
1153 IO.mapOptional("Align", Phdr.Align);
1154 IO.mapOptional("FileSize", Phdr.FileSize);
1155 IO.mapOptional("MemSize", Phdr.MemSize);
1156 IO.mapOptional("Offset", Phdr.Offset);
1160 IO &IO, ELFYAML::ProgramHeader &FileHdr) {
1205 NormalizedOther(IO &IO) : YamlIO(IO) {}
1206 NormalizedOther(IO &IO, std::optional<uint8_t> Original) : YamlIO(IO) {
1246 std::optional<uint8_t> denormalize(IO &) {
1293 IO &YamlIO;
1332 void MappingTraits<ELFYAML::Symbol>::mapping(IO &IO, ELFYAML::Symbol &Symbol) {
1333 IO.mapOptional("Name", Symbol.Name, StringRef());
1334 IO.mapOptional("StName", Symbol.StName);
1335 IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0));
1336 IO.mapOptional("Section", Symbol.Section);
1337 IO.mapOptional("Index", Symbol.Index);
1338 IO.mapOptional("Binding", Symbol.Binding, ELFYAML::ELF_STB(0));
1339 IO.mapOptional("Value", Symbol.Value);
1340 IO.mapOptional("Size", Symbol.Size);
1348 IO, Symbol.Other);
1349 IO.mapOptional("Other", Keys->Other);
1352 std::string MappingTraits<ELFYAML::Symbol>::validate(IO &IO,
1359 static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) {
1360 IO.mapOptional("Name", Section.Name, StringRef());
1361 IO.mapRequired("Type", Section.Type);
1362 IO.mapOptional("Flags", Section.Flags);
1363 IO.mapOptional("Address", Section.Address);
1364 IO.mapOptional("Link", Section.Link);
1365 IO.mapOptional("AddressAlign", Section.AddressAlign, Hex64(0));
1366 IO.mapOptional("EntSize", Section.EntSize);
1367 IO.mapOptional("Offset", Section.Offset);
1369 IO.mapOptional("Content", Section.Content);
1370 IO.mapOptional("Size", Section.Size);
1375 assert(!IO.outputting() ||
1378 IO.mapOptional("ShAddrAlign", Section.ShAddrAlign);
1379 IO.mapOptional("ShName", Section.ShName);
1380 IO.mapOptional("ShOffset", Section.ShOffset);
1381 IO.mapOptional("ShSize", Section.ShSize);
1382 IO.mapOptional("ShFlags", Section.ShFlags);
1383 IO.mapOptional("ShType", Section.ShType);
1386 static void sectionMapping(IO &IO, ELFYAML::DynamicSection &Section) {
1387 commonSectionMapping(IO, Section);
1388 IO.mapOptional("Entries", Section.Entries);
1391 static void sectionMapping(IO &IO, ELFYAML::RawContentSection &Section) {
1392 commonSectionMapping(IO, Section);
1396 assert(!IO.outputting() || !Section.ContentBuf);
1397 IO.mapOptional("ContentArray", Section.ContentBuf);
1400 IO.setError("Content and ContentArray can't be used together");
1404 IO.mapOptional("Info", Section.Info);
1407 static void sectionMapping(IO &IO, ELFYAML::BBAddrMapSection &Section) {
1408 commonSectionMapping(IO, Section);
1409 IO.mapOptional("Content", Section.Content);
1410 IO.mapOptional("Entries", Section.Entries);
1411 IO.mapOptional("PGOAnalyses", Section.PGOAnalyses);
1414 static void sectionMapping(IO &IO, ELFYAML::StackSizesSection &Section) {
1415 commonSectionMapping(IO, Section);
1416 IO.mapOptional("Entries", Section.Entries);
1419 static void sectionMapping(IO &IO, ELFYAML::HashSection &Section) {
1420 commonSectionMapping(IO, Section);
1421 IO.mapOptional("Bucket", Section.Bucket);
1422 IO.mapOptional("Chain", Section.Chain);
1426 assert(!IO.outputting() || (!Section.NBucket && !Section.NChain));
1427 IO.mapOptional("NChain", Section.NChain);
1428 IO.mapOptional("NBucket", Section.NBucket);
1431 static void sectionMapping(IO &IO, ELFYAML::NoteSection &Section) {
1432 commonSectionMapping(IO, Section);
1433 IO.mapOptional("Notes", Section.Notes);
1437 static void sectionMapping(IO &IO, ELFYAML::GnuHashSection &Section) {
1438 commonSectionMapping(IO, Section);
1439 IO.mapOptional("Header", Section.Header);
1440 IO.mapOptional("BloomFilter", Section.BloomFilter);
1441 IO.mapOptional("HashBuckets", Section.HashBuckets);
1442 IO.mapOptional("HashValues", Section.HashValues);
1444 static void sectionMapping(IO &IO, ELFYAML::NoBitsSection &Section) {
1445 commonSectionMapping(IO, Section);
1448 static void sectionMapping(IO &IO, ELFYAML::VerdefSection &Section) {
1449 commonSectionMapping(IO, Section);
1450 IO.mapOptional("Info", Section.Info);
1451 IO.mapOptional("Entries", Section.Entries);
1454 static void sectionMapping(IO &IO, ELFYAML::SymverSection &Section) {
1455 commonSectionMapping(IO, Section);
1456 IO.mapOptional("Entries", Section.Entries);
1459 static void sectionMapping(IO &IO, ELFYAML::VerneedSection &Section) {
1460 commonSectionMapping(IO, Section);
1461 IO.mapOptional("Info", Section.Info);
1462 IO.mapOptional("Dependencies", Section.VerneedV);
1465 static void sectionMapping(IO &IO, ELFYAML::RelocationSection &Section) {
1466 commonSectionMapping(IO, Section);
1467 IO.mapOptional("Info", Section.RelocatableSec, StringRef());
1468 IO.mapOptional("Relocations", Section.Relocations);
1471 static void sectionMapping(IO &IO, ELFYAML::RelrSection &Section) {
1472 commonSectionMapping(IO, Section);
1473 IO.mapOptional("Entries", Section.Entries);
1476 static void groupSectionMapping(IO &IO, ELFYAML::GroupSection &Group) {
1477 commonSectionMapping(IO, Group);
1478 IO.mapOptional("Info", Group.Signature);
1479 IO.mapOptional("Members", Group.Members);
1482 static void sectionMapping(IO &IO, ELFYAML::SymtabShndxSection &Section) {
1483 commonSectionMapping(IO, Section);
1484 IO.mapOptional("Entries", Section.Entries);
1487 static void sectionMapping(IO &IO, ELFYAML::AddrsigSection &Section) {
1488 commonSectionMapping(IO, Section);
1489 IO.mapOptional("Symbols", Section.Symbols);
1492 static void fillMapping(IO &IO, ELFYAML::Fill &Fill) {
1493 IO.mapOptional("Name", Fill.Name, StringRef());
1494 IO.mapOptional("Pattern", Fill.Pattern);
1495 IO.mapOptional("Offset", Fill.Offset);
1496 IO.mapRequired("Size", Fill.Size);
1499 static void sectionHeaderTableMapping(IO &IO,
1501 IO.mapOptional("Offset", SHT.Offset);
1502 IO.mapOptional("Sections", SHT.Sections);
1503 IO.mapOptional("Excluded", SHT.Excluded);
1504 IO.mapOptional("NoHeaders", SHT.NoHeaders);
1507 static void sectionMapping(IO &IO, ELFYAML::LinkerOptionsSection &Section) {
1508 commonSectionMapping(IO, Section);
1509 IO.mapOptional("Options", Section.Options);
1512 static void sectionMapping(IO &IO,
1514 commonSectionMapping(IO, Section);
1515 IO.mapOptional("Libraries", Section.Libs);
1518 static void sectionMapping(IO &IO, ELFYAML::CallGraphProfileSection &Section) {
1519 commonSectionMapping(IO, Section);
1520 IO.mapOptional("Entries", Section.Entries);
1524 IO &IO, ELFYAML::SectionOrType &sectionOrType) {
1525 IO.mapRequired("SectionOrType", sectionOrType.sectionNameOrType);
1528 static void sectionMapping(IO &IO, ELFYAML::ARMIndexTableSection &Section) {
1529 commonSectionMapping(IO, Section);
1530 IO.mapOptional("Entries", Section.Entries);
1533 static void sectionMapping(IO &IO, ELFYAML::MipsABIFlags &Section) {
1534 commonSectionMapping(IO, Section);
1535 IO.mapOptional("Version", Section.Version, Hex16(0));
1536 IO.mapRequired("ISA", Section.ISALevel);
1537 IO.mapOptional("ISARevision", Section.ISARevision, Hex8(0));
1538 IO.mapOptional("ISAExtension", Section.ISAExtension,
1540 IO.mapOptional("ASEs", Section.ASEs, ELFYAML::MIPS_AFL_ASE(0));
1541 IO.mapOptional("FpABI", Section.FpABI,
1543 IO.mapOptional("GPRSize", Section.GPRSize,
1545 IO.mapOptional("CPR1Size", Section.CPR1Size,
1547 IO.mapOptional("CPR2Size", Section.CPR2Size,
1549 IO.mapOptional("Flags1", Section.Flags1, ELFYAML::MIPS_AFL_FLAGS1(0));
1550 IO.mapOptional("Flags2", Section.Flags2, Hex32(0));
1553 static StringRef getStringValue(IO &IO, const char *Key) {
1555 IO.mapRequired(Key, Val);
1559 static void setStringValue(IO &IO, const char *Key, StringRef Val) {
1560 IO.mapRequired(Key, Val);
1569 IO &IO, std::unique_ptr<ELFYAML::Chunk> &Section) {
1572 if (IO.outputting()) {
1580 TypeStr = getStringValue(IO, "Type");
1582 IO.mapRequired("Type", Type);
1586 assert(!IO.outputting()); // We don't dump fills currently.
1588 fillMapping(IO, *cast<ELFYAML::Fill>(Section.get()));
1593 if (IO.outputting())
1594 setStringValue(IO, "Type", TypeStr);
1599 IO, *cast<ELFYAML::SectionHeaderTable>(Section.get()));
1603 const auto &Obj = *static_cast<ELFYAML::Object *>(IO.getContext());
1605 if (!IO.outputting())
1607 sectionMapping(IO, *cast<ELFYAML::MipsABIFlags>(Section.get()));
1612 if (!IO.outputting())
1614 sectionMapping(IO, *cast<ELFYAML::ARMIndexTableSection>(Section.get()));
1620 if (!IO.outputting())
1622 sectionMapping(IO, *cast<ELFYAML::DynamicSection>(Section.get()));
1627 if (!IO.outputting())
1629 sectionMapping(IO, *cast<ELFYAML::RelocationSection>(Section.get()));
1632 if (!IO.outputting())
1634 sectionMapping(IO, *cast<ELFYAML::RelrSection>(Section.get()));
1637 if (!IO.outputting())
1639 groupSectionMapping(IO, *cast<ELFYAML::GroupSection>(Section.get()));
1642 if (!IO.outputting())
1644 sectionMapping(IO, *cast<ELFYAML::NoBitsSection>(Section.get()));
1647 if (!IO.outputting())
1649 sectionMapping(IO, *cast<ELFYAML::HashSection>(Section.get()));
1652 if (!IO.outputting())
1654 sectionMapping(IO, *cast<ELFYAML::NoteSection>(Section.get()));
1657 if (!IO.outputting())
1659 sectionMapping(IO, *cast<ELFYAML::GnuHashSection>(Section.get()));
1662 if (!IO.outputting())
1664 sectionMapping(IO, *cast<ELFYAML::VerdefSection>(Section.get()));
1667 if (!IO.outputting())
1669 sectionMapping(IO, *cast<ELFYAML::SymverSection>(Section.get()));
1672 if (!IO.outputting())
1674 sectionMapping(IO, *cast<ELFYAML::VerneedSection>(Section.get()));
1677 if (!IO.outputting())
1679 sectionMapping(IO, *cast<ELFYAML::SymtabShndxSection>(Section.get()));
1682 if (!IO.outputting())
1684 sectionMapping(IO, *cast<ELFYAML::AddrsigSection>(Section.get()));
1687 if (!IO.outputting())
1689 sectionMapping(IO, *cast<ELFYAML::LinkerOptionsSection>(Section.get()));
1692 if (!IO.outputting())
1694 sectionMapping(IO,
1698 if (!IO.outputting())
1700 sectionMapping(IO, *cast<ELFYAML::CallGraphProfileSection>(Section.get()));
1703 if (!IO.outputting())
1705 sectionMapping(IO, *cast<ELFYAML::BBAddrMapSection>(Section.get()));
1708 if (!IO.outputting()) {
1710 IO.mapOptional("Name", Name, StringRef());
1720 sectionMapping(IO, *S);
1722 sectionMapping(IO, *cast<ELFYAML::StackSizesSection>(Section.get()));
1727 IO &io, std::unique_ptr<ELFYAML::Chunk> &C) {
1799 NormalizedMips64RelType(IO &)
1804 NormalizedMips64RelType(IO &, ELFYAML::ELF_REL Original)
1808 ELFYAML::ELF_REL denormalize(IO &) {
1822 IO &IO, ELFYAML::StackSizeEntry &E) {
1823 assert(IO.getContext() && "The IO context is not initialized");
1824 IO.mapOptional("Address", E.Address, Hex64(0));
1825 IO.mapRequired("Size", E.Size);
1829 IO &IO, ELFYAML::BBAddrMapEntry &E) {
1830 assert(IO.getContext() && "The IO context is not initialized");
1831 IO.mapRequired("Version", E.Version);
1832 IO.mapOptional("Feature", E.Feature, Hex8(0));
1833 IO.mapOptional("NumBBRanges", E.NumBBRanges);
1834 IO.mapOptional("BBRanges", E.BBRanges);
1838 IO &IO, ELFYAML::BBAddrMapEntry::BBRangeEntry &E) {
1839 IO.mapOptional("BaseAddress", E.BaseAddress, Hex64(0));
1840 IO.mapOptional("NumBlocks", E.NumBlocks);
1841 IO.mapOptional("BBEntries", E.BBEntries);
1845 IO &IO, ELFYAML::BBAddrMapEntry::BBEntry &E) {
1846 assert(IO.getContext() && "The IO context is not initialized");
1847 IO.mapOptional("ID", E.ID);
1848 IO.mapRequired("AddressOffset", E.AddressOffset);
1849 IO.mapRequired("Size", E.Size);
1850 IO.mapRequired("Metadata", E.Metadata);
1854 IO &IO, ELFYAML::PGOAnalysisMapEntry &E) {
1855 assert(IO.getContext() && "The IO context is not initialized");
1856 IO.mapOptional("FuncEntryCount", E.FuncEntryCount);
1857 IO.mapOptional("PGOBBEntries", E.PGOBBEntries);
1861 IO &IO, ELFYAML::PGOAnalysisMapEntry::PGOBBEntry &E) {
1862 assert(IO.getContext() && "The IO context is not initialized");
1863 IO.mapOptional("BBFreq", E.BBFreq);
1864 IO.mapOptional("Successors", E.Successors);
1868 mapping(IO &IO,
1870 assert(IO.getContext() && "The IO context is not initialized");
1871 IO.mapRequired("ID", E.ID);
1872 IO.mapRequired("BrProb", E.BrProb);
1875 void MappingTraits<ELFYAML::GnuHashHeader>::mapping(IO &IO,
1877 assert(IO.getContext() && "The IO context is not initialized");
1878 IO.mapOptional("NBuckets", E.NBuckets);
1879 IO.mapRequired("SymNdx", E.SymNdx);
1880 IO.mapOptional("MaskWords", E.MaskWords);
1881 IO.mapRequired("Shift2", E.Shift2);
1884 void MappingTraits<ELFYAML::DynamicEntry>::mapping(IO &IO,
1886 assert(IO.getContext() && "The IO context is not initialized");
1888 IO.mapRequired("Tag", Rel.Tag);
1889 IO.mapRequired("Value", Rel.Val);
1892 void MappingTraits<ELFYAML::NoteEntry>::mapping(IO &IO, ELFYAML::NoteEntry &N) {
1893 assert(IO.getContext() && "The IO context is not initialized");
1895 IO.mapOptional("Name", N.Name);
1896 IO.mapOptional("Desc", N.Desc);
1897 IO.mapRequired("Type", N.Type);
1900 void MappingTraits<ELFYAML::VerdefEntry>::mapping(IO &IO,
1902 assert(IO.getContext() && "The IO context is not initialized");
1904 IO.mapOptional("Version", E.Version);
1905 IO.mapOptional("Flags", E.Flags);
1906 IO.mapOptional("VersionNdx", E.VersionNdx);
1907 IO.mapOptional("Hash", E.Hash);
1908 IO.mapRequired("Names", E.VerNames);
1911 void MappingTraits<ELFYAML::VerneedEntry>::mapping(IO &IO,
1913 assert(IO.getContext() && "The IO context is not initialized");
1915 IO.mapRequired("Version", E.Version);
1916 IO.mapRequired("File", E.File);
1917 IO.mapRequired("Entries", E.AuxV);
1920 void MappingTraits<ELFYAML::VernauxEntry>::mapping(IO &IO,
1922 assert(IO.getContext() && "The IO context is not initialized");
1924 IO.mapRequired("Name", E.Name);
1925 IO.mapRequired("Hash", E.Hash);
1926 IO.mapRequired("Flags", E.Flags);
1927 IO.mapRequired("Other", E.Other);
1930 void MappingTraits<ELFYAML::Relocation>::mapping(IO &IO,
1932 const auto *Object = static_cast<ELFYAML::Object *>(IO.getContext());
1933 assert(Object && "The IO context is not initialized");
1935 IO.mapOptional("Offset", Rel.Offset, (Hex64)0);
1936 IO.mapOptional("Symbol", Rel.Symbol);
1941 IO, Rel.Type);
1942 IO.mapRequired("Type", Key->Type);
1943 IO.mapOptional("Type2", Key->Type2, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
1944 IO.mapOptional("Type3", Key->Type3, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
1945 IO.mapOptional("SpecSym", Key->SpecSym, ELFYAML::ELF_RSS(ELF::RSS_UNDEF));
1947 IO.mapRequired("Type", Rel.Type);
1949 IO.mapOptional("Addend", Rel.Addend, (ELFYAML::YAMLIntUInt)0);
1953 IO &IO, ELFYAML::ARMIndexTableEntry &E) {
1954 assert(IO.getContext() && "The IO context is not initialized");
1955 IO.mapRequired("Offset", E.Offset);
1958 if (IO.outputting() && (uint32_t)E.Value == ARM::EHABI::EXIDX_CANTUNWIND)
1959 IO.mapRequired("Value", CantUnwind);
1960 else if (!IO.outputting() && getStringValue(IO, "Value") == CantUnwind)
1963 IO.mapRequired("Value", E.Value);
1966 void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) {
1967 assert(!IO.getContext() && "The IO context is initialized already");
1968 IO.setContext(&Object);
1969 IO.mapTag("!ELF", true);
1970 IO.mapRequired("FileHeader", Object.Header);
1971 IO.mapOptional("ProgramHeaders", Object.ProgramHeaders);
1972 IO.mapOptional("Sections", Object.Chunks);
1973 IO.mapOptional("Symbols", Object.Symbols);
1974 IO.mapOptional("DynamicSymbols", Object.DynamicSymbols);
1975 IO.mapOptional("DWARF", Object.DWARF);
1982 IO.setContext(nullptr);
1985 void MappingTraits<ELFYAML::LinkerOption>::mapping(IO &IO,
1987 assert(IO.getContext() && "The IO context is not initialized");
1988 IO.mapRequired("Name", Opt.Key);
1989 IO.mapRequired("Value", Opt.Value);
1993 IO &IO, ELFYAML::CallGraphEntryWeight &E) {
1994 assert(IO.getContext() && "The IO context is not initialized");
1995 IO.mapRequired("Weight", E.Weight);