1*9880d681SAndroid Build Coastguard Worker //===- MachOYAML.cpp - MachO YAMLIO implementation ------------------------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file defines classes for handling the YAML representation of MachO.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker #include "llvm/ObjectYAML/MachOYAML.h"
15*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Casting.h"
16*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Format.h"
17*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/MachO.h"
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker #include <string.h> // For memcpy, memset and strnlen.
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker namespace llvm {
22*9880d681SAndroid Build Coastguard Worker
~LoadCommand()23*9880d681SAndroid Build Coastguard Worker MachOYAML::LoadCommand::~LoadCommand() {}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker namespace yaml {
26*9880d681SAndroid Build Coastguard Worker
output(const char_16 & Val,void *,llvm::raw_ostream & Out)27*9880d681SAndroid Build Coastguard Worker void ScalarTraits<char_16>::output(const char_16 &Val, void *,
28*9880d681SAndroid Build Coastguard Worker llvm::raw_ostream &Out) {
29*9880d681SAndroid Build Coastguard Worker auto Len = strnlen(&Val[0], 16);
30*9880d681SAndroid Build Coastguard Worker Out << StringRef(&Val[0], Len);
31*9880d681SAndroid Build Coastguard Worker }
32*9880d681SAndroid Build Coastguard Worker
input(StringRef Scalar,void *,char_16 & Val)33*9880d681SAndroid Build Coastguard Worker StringRef ScalarTraits<char_16>::input(StringRef Scalar, void *, char_16 &Val) {
34*9880d681SAndroid Build Coastguard Worker size_t CopySize = 16 >= Scalar.size() ? 16 : Scalar.size();
35*9880d681SAndroid Build Coastguard Worker memcpy((void *)Val, Scalar.data(), CopySize);
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker if (Scalar.size() < 16) {
38*9880d681SAndroid Build Coastguard Worker memset((void *)&Val[Scalar.size()], 0, 16 - Scalar.size());
39*9880d681SAndroid Build Coastguard Worker }
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker return StringRef();
42*9880d681SAndroid Build Coastguard Worker }
43*9880d681SAndroid Build Coastguard Worker
mustQuote(StringRef S)44*9880d681SAndroid Build Coastguard Worker bool ScalarTraits<char_16>::mustQuote(StringRef S) { return needsQuotes(S); }
45*9880d681SAndroid Build Coastguard Worker
output(const uuid_t & Val,void *,llvm::raw_ostream & Out)46*9880d681SAndroid Build Coastguard Worker void ScalarTraits<uuid_t>::output(const uuid_t &Val, void *,
47*9880d681SAndroid Build Coastguard Worker llvm::raw_ostream &Out) {
48*9880d681SAndroid Build Coastguard Worker for (int Idx = 0; Idx < 16; ++Idx) {
49*9880d681SAndroid Build Coastguard Worker Out << format("%02" PRIX32, Val[Idx]);
50*9880d681SAndroid Build Coastguard Worker if (Idx == 3 || Idx == 5 || Idx == 7 || Idx == 9)
51*9880d681SAndroid Build Coastguard Worker Out << "-";
52*9880d681SAndroid Build Coastguard Worker }
53*9880d681SAndroid Build Coastguard Worker }
54*9880d681SAndroid Build Coastguard Worker
input(StringRef Scalar,void *,uuid_t & Val)55*9880d681SAndroid Build Coastguard Worker StringRef ScalarTraits<uuid_t>::input(StringRef Scalar, void *, uuid_t &Val) {
56*9880d681SAndroid Build Coastguard Worker size_t OutIdx = 0;
57*9880d681SAndroid Build Coastguard Worker for (size_t Idx = 0; Idx < Scalar.size(); ++Idx) {
58*9880d681SAndroid Build Coastguard Worker if (Scalar[Idx] == '-' || OutIdx >= 16)
59*9880d681SAndroid Build Coastguard Worker continue;
60*9880d681SAndroid Build Coastguard Worker unsigned long long TempInt;
61*9880d681SAndroid Build Coastguard Worker if (getAsUnsignedInteger(Scalar.slice(Idx, Idx + 2), 16, TempInt))
62*9880d681SAndroid Build Coastguard Worker return "invalid number";
63*9880d681SAndroid Build Coastguard Worker if (TempInt > 0xFF)
64*9880d681SAndroid Build Coastguard Worker return "out of range number";
65*9880d681SAndroid Build Coastguard Worker Val[OutIdx] = static_cast<uint8_t>(TempInt);
66*9880d681SAndroid Build Coastguard Worker ++Idx; // increment idx an extra time because we're consuming 2 chars
67*9880d681SAndroid Build Coastguard Worker ++OutIdx;
68*9880d681SAndroid Build Coastguard Worker }
69*9880d681SAndroid Build Coastguard Worker return StringRef();
70*9880d681SAndroid Build Coastguard Worker }
71*9880d681SAndroid Build Coastguard Worker
mustQuote(StringRef S)72*9880d681SAndroid Build Coastguard Worker bool ScalarTraits<uuid_t>::mustQuote(StringRef S) { return needsQuotes(S); }
73*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::FileHeader & FileHdr)74*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::FileHeader>::mapping(
75*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::FileHeader &FileHdr) {
76*9880d681SAndroid Build Coastguard Worker IO.mapRequired("magic", FileHdr.magic);
77*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cputype", FileHdr.cputype);
78*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cpusubtype", FileHdr.cpusubtype);
79*9880d681SAndroid Build Coastguard Worker IO.mapRequired("filetype", FileHdr.filetype);
80*9880d681SAndroid Build Coastguard Worker IO.mapRequired("ncmds", FileHdr.ncmds);
81*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sizeofcmds", FileHdr.sizeofcmds);
82*9880d681SAndroid Build Coastguard Worker IO.mapRequired("flags", FileHdr.flags);
83*9880d681SAndroid Build Coastguard Worker if (FileHdr.magic == MachO::MH_MAGIC_64 ||
84*9880d681SAndroid Build Coastguard Worker FileHdr.magic == MachO::MH_CIGAM_64)
85*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved", FileHdr.reserved);
86*9880d681SAndroid Build Coastguard Worker }
87*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::Object & Object)88*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::Object>::mapping(IO &IO,
89*9880d681SAndroid Build Coastguard Worker MachOYAML::Object &Object) {
90*9880d681SAndroid Build Coastguard Worker // If the context isn't already set, tag the document as !mach-o.
91*9880d681SAndroid Build Coastguard Worker // For Fat files there will be a different tag so they can be differentiated.
92*9880d681SAndroid Build Coastguard Worker if (!IO.getContext()) {
93*9880d681SAndroid Build Coastguard Worker IO.setContext(&Object);
94*9880d681SAndroid Build Coastguard Worker }
95*9880d681SAndroid Build Coastguard Worker IO.mapTag("!mach-o", true);
96*9880d681SAndroid Build Coastguard Worker IO.mapRequired("FileHeader", Object.Header);
97*9880d681SAndroid Build Coastguard Worker IO.mapOptional("LoadCommands", Object.LoadCommands);
98*9880d681SAndroid Build Coastguard Worker IO.mapOptional("LinkEditData", Object.LinkEdit);
99*9880d681SAndroid Build Coastguard Worker
100*9880d681SAndroid Build Coastguard Worker if (IO.getContext() == &Object)
101*9880d681SAndroid Build Coastguard Worker IO.setContext(nullptr);
102*9880d681SAndroid Build Coastguard Worker }
103*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::FatHeader & FatHeader)104*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::FatHeader>::mapping(
105*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::FatHeader &FatHeader) {
106*9880d681SAndroid Build Coastguard Worker IO.mapRequired("magic", FatHeader.magic);
107*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nfat_arch", FatHeader.nfat_arch);
108*9880d681SAndroid Build Coastguard Worker }
109*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::FatArch & FatArch)110*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::FatArch>::mapping(IO &IO,
111*9880d681SAndroid Build Coastguard Worker MachOYAML::FatArch &FatArch) {
112*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cputype", FatArch.cputype);
113*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cpusubtype", FatArch.cpusubtype);
114*9880d681SAndroid Build Coastguard Worker IO.mapRequired("offset", FatArch.offset);
115*9880d681SAndroid Build Coastguard Worker IO.mapRequired("size", FatArch.size);
116*9880d681SAndroid Build Coastguard Worker IO.mapRequired("align", FatArch.align);
117*9880d681SAndroid Build Coastguard Worker IO.mapOptional("reserved", FatArch.reserved,
118*9880d681SAndroid Build Coastguard Worker static_cast<llvm::yaml::Hex32>(0));
119*9880d681SAndroid Build Coastguard Worker }
120*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::UniversalBinary & UniversalBinary)121*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::UniversalBinary>::mapping(
122*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::UniversalBinary &UniversalBinary) {
123*9880d681SAndroid Build Coastguard Worker if (!IO.getContext()) {
124*9880d681SAndroid Build Coastguard Worker IO.setContext(&UniversalBinary);
125*9880d681SAndroid Build Coastguard Worker IO.mapTag("!fat-mach-o", true);
126*9880d681SAndroid Build Coastguard Worker }
127*9880d681SAndroid Build Coastguard Worker IO.mapRequired("FatHeader", UniversalBinary.Header);
128*9880d681SAndroid Build Coastguard Worker IO.mapRequired("FatArchs", UniversalBinary.FatArchs);
129*9880d681SAndroid Build Coastguard Worker IO.mapRequired("Slices", UniversalBinary.Slices);
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard Worker if (IO.getContext() == &UniversalBinary)
132*9880d681SAndroid Build Coastguard Worker IO.setContext(nullptr);
133*9880d681SAndroid Build Coastguard Worker }
134*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::LinkEditData & LinkEditData)135*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::LinkEditData>::mapping(
136*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LinkEditData &LinkEditData) {
137*9880d681SAndroid Build Coastguard Worker IO.mapOptional("RebaseOpcodes", LinkEditData.RebaseOpcodes);
138*9880d681SAndroid Build Coastguard Worker IO.mapOptional("BindOpcodes", LinkEditData.BindOpcodes);
139*9880d681SAndroid Build Coastguard Worker IO.mapOptional("WeakBindOpcodes", LinkEditData.WeakBindOpcodes);
140*9880d681SAndroid Build Coastguard Worker IO.mapOptional("LazyBindOpcodes", LinkEditData.LazyBindOpcodes);
141*9880d681SAndroid Build Coastguard Worker IO.mapOptional("ExportTrie", LinkEditData.ExportTrie);
142*9880d681SAndroid Build Coastguard Worker IO.mapOptional("NameList", LinkEditData.NameList);
143*9880d681SAndroid Build Coastguard Worker IO.mapOptional("StringTable", LinkEditData.StringTable);
144*9880d681SAndroid Build Coastguard Worker }
145*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::RebaseOpcode & RebaseOpcode)146*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::RebaseOpcode>::mapping(
147*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::RebaseOpcode &RebaseOpcode) {
148*9880d681SAndroid Build Coastguard Worker IO.mapRequired("Opcode", RebaseOpcode.Opcode);
149*9880d681SAndroid Build Coastguard Worker IO.mapRequired("Imm", RebaseOpcode.Imm);
150*9880d681SAndroid Build Coastguard Worker IO.mapOptional("ExtraData", RebaseOpcode.ExtraData);
151*9880d681SAndroid Build Coastguard Worker }
152*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::BindOpcode & BindOpcode)153*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::BindOpcode>::mapping(
154*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::BindOpcode &BindOpcode) {
155*9880d681SAndroid Build Coastguard Worker IO.mapRequired("Opcode", BindOpcode.Opcode);
156*9880d681SAndroid Build Coastguard Worker IO.mapRequired("Imm", BindOpcode.Imm);
157*9880d681SAndroid Build Coastguard Worker IO.mapOptional("ULEBExtraData", BindOpcode.ULEBExtraData);
158*9880d681SAndroid Build Coastguard Worker IO.mapOptional("SLEBExtraData", BindOpcode.SLEBExtraData);
159*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Symbol", BindOpcode.Symbol);
160*9880d681SAndroid Build Coastguard Worker }
161*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::ExportEntry & ExportEntry)162*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::ExportEntry>::mapping(
163*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::ExportEntry &ExportEntry) {
164*9880d681SAndroid Build Coastguard Worker IO.mapRequired("TerminalSize", ExportEntry.TerminalSize);
165*9880d681SAndroid Build Coastguard Worker IO.mapOptional("NodeOffset", ExportEntry.NodeOffset);
166*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Name", ExportEntry.Name);
167*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Flags", ExportEntry.Flags);
168*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Address", ExportEntry.Address);
169*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Other", ExportEntry.Other);
170*9880d681SAndroid Build Coastguard Worker IO.mapOptional("ImportName", ExportEntry.ImportName);
171*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Children", ExportEntry.Children);
172*9880d681SAndroid Build Coastguard Worker }
173*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::NListEntry & NListEntry)174*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::NListEntry>::mapping(
175*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::NListEntry &NListEntry) {
176*9880d681SAndroid Build Coastguard Worker IO.mapRequired("n_strx", NListEntry.n_strx);
177*9880d681SAndroid Build Coastguard Worker IO.mapRequired("n_type", NListEntry.n_type);
178*9880d681SAndroid Build Coastguard Worker IO.mapRequired("n_sect", NListEntry.n_sect);
179*9880d681SAndroid Build Coastguard Worker IO.mapRequired("n_desc", NListEntry.n_desc);
180*9880d681SAndroid Build Coastguard Worker IO.mapRequired("n_value", NListEntry.n_value);
181*9880d681SAndroid Build Coastguard Worker }
182*9880d681SAndroid Build Coastguard Worker
183*9880d681SAndroid Build Coastguard Worker template <typename StructType>
mapLoadCommandData(IO & IO,MachOYAML::LoadCommand & LoadCommand)184*9880d681SAndroid Build Coastguard Worker void mapLoadCommandData(IO &IO, MachOYAML::LoadCommand &LoadCommand) {}
185*9880d681SAndroid Build Coastguard Worker
186*9880d681SAndroid Build Coastguard Worker template <>
mapLoadCommandData(IO & IO,MachOYAML::LoadCommand & LoadCommand)187*9880d681SAndroid Build Coastguard Worker void mapLoadCommandData<MachO::segment_command>(
188*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LoadCommand &LoadCommand) {
189*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Sections", LoadCommand.Sections);
190*9880d681SAndroid Build Coastguard Worker }
191*9880d681SAndroid Build Coastguard Worker
192*9880d681SAndroid Build Coastguard Worker template <>
mapLoadCommandData(IO & IO,MachOYAML::LoadCommand & LoadCommand)193*9880d681SAndroid Build Coastguard Worker void mapLoadCommandData<MachO::segment_command_64>(
194*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LoadCommand &LoadCommand) {
195*9880d681SAndroid Build Coastguard Worker IO.mapOptional("Sections", LoadCommand.Sections);
196*9880d681SAndroid Build Coastguard Worker }
197*9880d681SAndroid Build Coastguard Worker
198*9880d681SAndroid Build Coastguard Worker template <>
mapLoadCommandData(IO & IO,MachOYAML::LoadCommand & LoadCommand)199*9880d681SAndroid Build Coastguard Worker void mapLoadCommandData<MachO::dylib_command>(
200*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LoadCommand &LoadCommand) {
201*9880d681SAndroid Build Coastguard Worker IO.mapOptional("PayloadString", LoadCommand.PayloadString);
202*9880d681SAndroid Build Coastguard Worker }
203*9880d681SAndroid Build Coastguard Worker
204*9880d681SAndroid Build Coastguard Worker template <>
mapLoadCommandData(IO & IO,MachOYAML::LoadCommand & LoadCommand)205*9880d681SAndroid Build Coastguard Worker void mapLoadCommandData<MachO::rpath_command>(
206*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LoadCommand &LoadCommand) {
207*9880d681SAndroid Build Coastguard Worker IO.mapOptional("PayloadString", LoadCommand.PayloadString);
208*9880d681SAndroid Build Coastguard Worker }
209*9880d681SAndroid Build Coastguard Worker
210*9880d681SAndroid Build Coastguard Worker template <>
mapLoadCommandData(IO & IO,MachOYAML::LoadCommand & LoadCommand)211*9880d681SAndroid Build Coastguard Worker void mapLoadCommandData<MachO::dylinker_command>(
212*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LoadCommand &LoadCommand) {
213*9880d681SAndroid Build Coastguard Worker IO.mapOptional("PayloadString", LoadCommand.PayloadString);
214*9880d681SAndroid Build Coastguard Worker }
215*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::LoadCommand & LoadCommand)216*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::LoadCommand>::mapping(
217*9880d681SAndroid Build Coastguard Worker IO &IO, MachOYAML::LoadCommand &LoadCommand) {
218*9880d681SAndroid Build Coastguard Worker MachO::LoadCommandType TempCmd = static_cast<MachO::LoadCommandType>(
219*9880d681SAndroid Build Coastguard Worker LoadCommand.Data.load_command_data.cmd);
220*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cmd", TempCmd);
221*9880d681SAndroid Build Coastguard Worker LoadCommand.Data.load_command_data.cmd = TempCmd;
222*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cmdsize", LoadCommand.Data.load_command_data.cmdsize);
223*9880d681SAndroid Build Coastguard Worker
224*9880d681SAndroid Build Coastguard Worker #define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) \
225*9880d681SAndroid Build Coastguard Worker case MachO::LCName: \
226*9880d681SAndroid Build Coastguard Worker MappingTraits<MachO::LCStruct>::mapping(IO, \
227*9880d681SAndroid Build Coastguard Worker LoadCommand.Data.LCStruct##_data); \
228*9880d681SAndroid Build Coastguard Worker mapLoadCommandData<MachO::LCStruct>(IO, LoadCommand); \
229*9880d681SAndroid Build Coastguard Worker break;
230*9880d681SAndroid Build Coastguard Worker
231*9880d681SAndroid Build Coastguard Worker switch (LoadCommand.Data.load_command_data.cmd) {
232*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/MachO.def"
233*9880d681SAndroid Build Coastguard Worker }
234*9880d681SAndroid Build Coastguard Worker IO.mapOptional("PayloadBytes", LoadCommand.PayloadBytes);
235*9880d681SAndroid Build Coastguard Worker IO.mapOptional("ZeroPadBytes", LoadCommand.ZeroPadBytes, (uint64_t)0ull);
236*9880d681SAndroid Build Coastguard Worker }
237*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::dyld_info_command & LoadCommand)238*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::dyld_info_command>::mapping(
239*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::dyld_info_command &LoadCommand) {
240*9880d681SAndroid Build Coastguard Worker IO.mapRequired("rebase_off", LoadCommand.rebase_off);
241*9880d681SAndroid Build Coastguard Worker IO.mapRequired("rebase_size", LoadCommand.rebase_size);
242*9880d681SAndroid Build Coastguard Worker IO.mapRequired("bind_off", LoadCommand.bind_off);
243*9880d681SAndroid Build Coastguard Worker IO.mapRequired("bind_size", LoadCommand.bind_size);
244*9880d681SAndroid Build Coastguard Worker IO.mapRequired("weak_bind_off", LoadCommand.weak_bind_off);
245*9880d681SAndroid Build Coastguard Worker IO.mapRequired("weak_bind_size", LoadCommand.weak_bind_size);
246*9880d681SAndroid Build Coastguard Worker IO.mapRequired("lazy_bind_off", LoadCommand.lazy_bind_off);
247*9880d681SAndroid Build Coastguard Worker IO.mapRequired("lazy_bind_size", LoadCommand.lazy_bind_size);
248*9880d681SAndroid Build Coastguard Worker IO.mapRequired("export_off", LoadCommand.export_off);
249*9880d681SAndroid Build Coastguard Worker IO.mapRequired("export_size", LoadCommand.export_size);
250*9880d681SAndroid Build Coastguard Worker }
251*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachOYAML::Section & Section)252*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachOYAML::Section>::mapping(IO &IO,
253*9880d681SAndroid Build Coastguard Worker MachOYAML::Section &Section) {
254*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sectname", Section.sectname);
255*9880d681SAndroid Build Coastguard Worker IO.mapRequired("segname", Section.segname);
256*9880d681SAndroid Build Coastguard Worker IO.mapRequired("addr", Section.addr);
257*9880d681SAndroid Build Coastguard Worker IO.mapRequired("size", Section.size);
258*9880d681SAndroid Build Coastguard Worker IO.mapRequired("offset", Section.offset);
259*9880d681SAndroid Build Coastguard Worker IO.mapRequired("align", Section.align);
260*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reloff", Section.reloff);
261*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nreloc", Section.nreloc);
262*9880d681SAndroid Build Coastguard Worker IO.mapRequired("flags", Section.flags);
263*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved1", Section.reserved1);
264*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved2", Section.reserved2);
265*9880d681SAndroid Build Coastguard Worker IO.mapOptional("reserved3", Section.reserved3);
266*9880d681SAndroid Build Coastguard Worker }
267*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::dylib & DylibStruct)268*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::dylib>::mapping(IO &IO, MachO::dylib &DylibStruct) {
269*9880d681SAndroid Build Coastguard Worker IO.mapRequired("name", DylibStruct.name);
270*9880d681SAndroid Build Coastguard Worker IO.mapRequired("timestamp", DylibStruct.timestamp);
271*9880d681SAndroid Build Coastguard Worker IO.mapRequired("current_version", DylibStruct.current_version);
272*9880d681SAndroid Build Coastguard Worker IO.mapRequired("compatibility_version", DylibStruct.compatibility_version);
273*9880d681SAndroid Build Coastguard Worker }
274*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::dylib_command & LoadCommand)275*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::dylib_command>::mapping(
276*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::dylib_command &LoadCommand) {
277*9880d681SAndroid Build Coastguard Worker IO.mapRequired("dylib", LoadCommand.dylib);
278*9880d681SAndroid Build Coastguard Worker }
279*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::dylinker_command & LoadCommand)280*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::dylinker_command>::mapping(
281*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::dylinker_command &LoadCommand) {
282*9880d681SAndroid Build Coastguard Worker
283*9880d681SAndroid Build Coastguard Worker IO.mapRequired("name", LoadCommand.name);
284*9880d681SAndroid Build Coastguard Worker }
285*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::dysymtab_command & LoadCommand)286*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::dysymtab_command>::mapping(
287*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::dysymtab_command &LoadCommand) {
288*9880d681SAndroid Build Coastguard Worker
289*9880d681SAndroid Build Coastguard Worker IO.mapRequired("ilocalsym", LoadCommand.ilocalsym);
290*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nlocalsym", LoadCommand.nlocalsym);
291*9880d681SAndroid Build Coastguard Worker IO.mapRequired("iextdefsym", LoadCommand.iextdefsym);
292*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nextdefsym", LoadCommand.nextdefsym);
293*9880d681SAndroid Build Coastguard Worker IO.mapRequired("iundefsym", LoadCommand.iundefsym);
294*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nundefsym", LoadCommand.nundefsym);
295*9880d681SAndroid Build Coastguard Worker IO.mapRequired("tocoff", LoadCommand.tocoff);
296*9880d681SAndroid Build Coastguard Worker IO.mapRequired("ntoc", LoadCommand.ntoc);
297*9880d681SAndroid Build Coastguard Worker IO.mapRequired("modtaboff", LoadCommand.modtaboff);
298*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nmodtab", LoadCommand.nmodtab);
299*9880d681SAndroid Build Coastguard Worker IO.mapRequired("extrefsymoff", LoadCommand.extrefsymoff);
300*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nextrefsyms", LoadCommand.nextrefsyms);
301*9880d681SAndroid Build Coastguard Worker IO.mapRequired("indirectsymoff", LoadCommand.indirectsymoff);
302*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nindirectsyms", LoadCommand.nindirectsyms);
303*9880d681SAndroid Build Coastguard Worker IO.mapRequired("extreloff", LoadCommand.extreloff);
304*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nextrel", LoadCommand.nextrel);
305*9880d681SAndroid Build Coastguard Worker IO.mapRequired("locreloff", LoadCommand.locreloff);
306*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nlocrel", LoadCommand.nlocrel);
307*9880d681SAndroid Build Coastguard Worker }
308*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::encryption_info_command & LoadCommand)309*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::encryption_info_command>::mapping(
310*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::encryption_info_command &LoadCommand) {
311*9880d681SAndroid Build Coastguard Worker
312*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cryptoff", LoadCommand.cryptoff);
313*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cryptsize", LoadCommand.cryptsize);
314*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cryptid", LoadCommand.cryptid);
315*9880d681SAndroid Build Coastguard Worker }
316*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::encryption_info_command_64 & LoadCommand)317*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::encryption_info_command_64>::mapping(
318*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::encryption_info_command_64 &LoadCommand) {
319*9880d681SAndroid Build Coastguard Worker
320*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cryptoff", LoadCommand.cryptoff);
321*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cryptsize", LoadCommand.cryptsize);
322*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cryptid", LoadCommand.cryptid);
323*9880d681SAndroid Build Coastguard Worker IO.mapRequired("pad", LoadCommand.pad);
324*9880d681SAndroid Build Coastguard Worker }
325*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::entry_point_command & LoadCommand)326*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::entry_point_command>::mapping(
327*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::entry_point_command &LoadCommand) {
328*9880d681SAndroid Build Coastguard Worker
329*9880d681SAndroid Build Coastguard Worker IO.mapRequired("entryoff", LoadCommand.entryoff);
330*9880d681SAndroid Build Coastguard Worker IO.mapRequired("stacksize", LoadCommand.stacksize);
331*9880d681SAndroid Build Coastguard Worker }
332*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::fvmfile_command & LoadCommand)333*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::fvmfile_command>::mapping(
334*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::fvmfile_command &LoadCommand) {
335*9880d681SAndroid Build Coastguard Worker
336*9880d681SAndroid Build Coastguard Worker IO.mapRequired("name", LoadCommand.name);
337*9880d681SAndroid Build Coastguard Worker IO.mapRequired("header_addr", LoadCommand.header_addr);
338*9880d681SAndroid Build Coastguard Worker }
339*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::fvmlib & FVMLib)340*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::fvmlib>::mapping(IO &IO, MachO::fvmlib &FVMLib) {
341*9880d681SAndroid Build Coastguard Worker IO.mapRequired("name", FVMLib.name);
342*9880d681SAndroid Build Coastguard Worker IO.mapRequired("minor_version", FVMLib.minor_version);
343*9880d681SAndroid Build Coastguard Worker IO.mapRequired("header_addr", FVMLib.header_addr);
344*9880d681SAndroid Build Coastguard Worker }
345*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::fvmlib_command & LoadCommand)346*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::fvmlib_command>::mapping(
347*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::fvmlib_command &LoadCommand) {
348*9880d681SAndroid Build Coastguard Worker
349*9880d681SAndroid Build Coastguard Worker IO.mapRequired("fvmlib", LoadCommand.fvmlib);
350*9880d681SAndroid Build Coastguard Worker }
351*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::ident_command & LoadCommand)352*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::ident_command>::mapping(
353*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::ident_command &LoadCommand) {}
354*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::linkedit_data_command & LoadCommand)355*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::linkedit_data_command>::mapping(
356*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::linkedit_data_command &LoadCommand) {
357*9880d681SAndroid Build Coastguard Worker
358*9880d681SAndroid Build Coastguard Worker IO.mapRequired("dataoff", LoadCommand.dataoff);
359*9880d681SAndroid Build Coastguard Worker IO.mapRequired("datasize", LoadCommand.datasize);
360*9880d681SAndroid Build Coastguard Worker }
361*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::linker_option_command & LoadCommand)362*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::linker_option_command>::mapping(
363*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::linker_option_command &LoadCommand) {
364*9880d681SAndroid Build Coastguard Worker
365*9880d681SAndroid Build Coastguard Worker IO.mapRequired("count", LoadCommand.count);
366*9880d681SAndroid Build Coastguard Worker }
367*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::prebind_cksum_command & LoadCommand)368*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::prebind_cksum_command>::mapping(
369*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::prebind_cksum_command &LoadCommand) {
370*9880d681SAndroid Build Coastguard Worker
371*9880d681SAndroid Build Coastguard Worker IO.mapRequired("cksum", LoadCommand.cksum);
372*9880d681SAndroid Build Coastguard Worker }
373*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::load_command & LoadCommand)374*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::load_command>::mapping(
375*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::load_command &LoadCommand) {}
376*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::prebound_dylib_command & LoadCommand)377*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::prebound_dylib_command>::mapping(
378*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::prebound_dylib_command &LoadCommand) {
379*9880d681SAndroid Build Coastguard Worker
380*9880d681SAndroid Build Coastguard Worker IO.mapRequired("name", LoadCommand.name);
381*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nmodules", LoadCommand.nmodules);
382*9880d681SAndroid Build Coastguard Worker IO.mapRequired("linked_modules", LoadCommand.linked_modules);
383*9880d681SAndroid Build Coastguard Worker }
384*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::routines_command & LoadCommand)385*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::routines_command>::mapping(
386*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::routines_command &LoadCommand) {
387*9880d681SAndroid Build Coastguard Worker
388*9880d681SAndroid Build Coastguard Worker IO.mapRequired("init_address", LoadCommand.init_address);
389*9880d681SAndroid Build Coastguard Worker IO.mapRequired("init_module", LoadCommand.init_module);
390*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved1", LoadCommand.reserved1);
391*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved2", LoadCommand.reserved2);
392*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved3", LoadCommand.reserved3);
393*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved4", LoadCommand.reserved4);
394*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved5", LoadCommand.reserved5);
395*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved6", LoadCommand.reserved6);
396*9880d681SAndroid Build Coastguard Worker }
397*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::routines_command_64 & LoadCommand)398*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::routines_command_64>::mapping(
399*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::routines_command_64 &LoadCommand) {
400*9880d681SAndroid Build Coastguard Worker
401*9880d681SAndroid Build Coastguard Worker IO.mapRequired("init_address", LoadCommand.init_address);
402*9880d681SAndroid Build Coastguard Worker IO.mapRequired("init_module", LoadCommand.init_module);
403*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved1", LoadCommand.reserved1);
404*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved2", LoadCommand.reserved2);
405*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved3", LoadCommand.reserved3);
406*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved4", LoadCommand.reserved4);
407*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved5", LoadCommand.reserved5);
408*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved6", LoadCommand.reserved6);
409*9880d681SAndroid Build Coastguard Worker }
410*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::rpath_command & LoadCommand)411*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::rpath_command>::mapping(
412*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::rpath_command &LoadCommand) {
413*9880d681SAndroid Build Coastguard Worker
414*9880d681SAndroid Build Coastguard Worker IO.mapRequired("path", LoadCommand.path);
415*9880d681SAndroid Build Coastguard Worker }
416*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::section & Section)417*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::section>::mapping(IO &IO, MachO::section &Section) {
418*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sectname", Section.sectname);
419*9880d681SAndroid Build Coastguard Worker IO.mapRequired("segname", Section.segname);
420*9880d681SAndroid Build Coastguard Worker IO.mapRequired("addr", Section.addr);
421*9880d681SAndroid Build Coastguard Worker IO.mapRequired("size", Section.size);
422*9880d681SAndroid Build Coastguard Worker IO.mapRequired("offset", Section.offset);
423*9880d681SAndroid Build Coastguard Worker IO.mapRequired("align", Section.align);
424*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reloff", Section.reloff);
425*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nreloc", Section.nreloc);
426*9880d681SAndroid Build Coastguard Worker IO.mapRequired("flags", Section.flags);
427*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved1", Section.reserved1);
428*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved2", Section.reserved2);
429*9880d681SAndroid Build Coastguard Worker }
430*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::section_64 & Section)431*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::section_64>::mapping(IO &IO,
432*9880d681SAndroid Build Coastguard Worker MachO::section_64 &Section) {
433*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sectname", Section.sectname);
434*9880d681SAndroid Build Coastguard Worker IO.mapRequired("segname", Section.segname);
435*9880d681SAndroid Build Coastguard Worker IO.mapRequired("addr", Section.addr);
436*9880d681SAndroid Build Coastguard Worker IO.mapRequired("size", Section.size);
437*9880d681SAndroid Build Coastguard Worker IO.mapRequired("offset", Section.offset);
438*9880d681SAndroid Build Coastguard Worker IO.mapRequired("align", Section.align);
439*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reloff", Section.reloff);
440*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nreloc", Section.nreloc);
441*9880d681SAndroid Build Coastguard Worker IO.mapRequired("flags", Section.flags);
442*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved1", Section.reserved1);
443*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved2", Section.reserved2);
444*9880d681SAndroid Build Coastguard Worker IO.mapRequired("reserved3", Section.reserved3);
445*9880d681SAndroid Build Coastguard Worker }
446*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::segment_command & LoadCommand)447*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::segment_command>::mapping(
448*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::segment_command &LoadCommand) {
449*9880d681SAndroid Build Coastguard Worker
450*9880d681SAndroid Build Coastguard Worker IO.mapRequired("segname", LoadCommand.segname);
451*9880d681SAndroid Build Coastguard Worker IO.mapRequired("vmaddr", LoadCommand.vmaddr);
452*9880d681SAndroid Build Coastguard Worker IO.mapRequired("vmsize", LoadCommand.vmsize);
453*9880d681SAndroid Build Coastguard Worker IO.mapRequired("fileoff", LoadCommand.fileoff);
454*9880d681SAndroid Build Coastguard Worker IO.mapRequired("filesize", LoadCommand.filesize);
455*9880d681SAndroid Build Coastguard Worker IO.mapRequired("maxprot", LoadCommand.maxprot);
456*9880d681SAndroid Build Coastguard Worker IO.mapRequired("initprot", LoadCommand.initprot);
457*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nsects", LoadCommand.nsects);
458*9880d681SAndroid Build Coastguard Worker IO.mapRequired("flags", LoadCommand.flags);
459*9880d681SAndroid Build Coastguard Worker }
460*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::segment_command_64 & LoadCommand)461*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::segment_command_64>::mapping(
462*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::segment_command_64 &LoadCommand) {
463*9880d681SAndroid Build Coastguard Worker
464*9880d681SAndroid Build Coastguard Worker IO.mapRequired("segname", LoadCommand.segname);
465*9880d681SAndroid Build Coastguard Worker IO.mapRequired("vmaddr", LoadCommand.vmaddr);
466*9880d681SAndroid Build Coastguard Worker IO.mapRequired("vmsize", LoadCommand.vmsize);
467*9880d681SAndroid Build Coastguard Worker IO.mapRequired("fileoff", LoadCommand.fileoff);
468*9880d681SAndroid Build Coastguard Worker IO.mapRequired("filesize", LoadCommand.filesize);
469*9880d681SAndroid Build Coastguard Worker IO.mapRequired("maxprot", LoadCommand.maxprot);
470*9880d681SAndroid Build Coastguard Worker IO.mapRequired("initprot", LoadCommand.initprot);
471*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nsects", LoadCommand.nsects);
472*9880d681SAndroid Build Coastguard Worker IO.mapRequired("flags", LoadCommand.flags);
473*9880d681SAndroid Build Coastguard Worker }
474*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::source_version_command & LoadCommand)475*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::source_version_command>::mapping(
476*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::source_version_command &LoadCommand) {
477*9880d681SAndroid Build Coastguard Worker
478*9880d681SAndroid Build Coastguard Worker IO.mapRequired("version", LoadCommand.version);
479*9880d681SAndroid Build Coastguard Worker }
480*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::sub_client_command & LoadCommand)481*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::sub_client_command>::mapping(
482*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::sub_client_command &LoadCommand) {
483*9880d681SAndroid Build Coastguard Worker
484*9880d681SAndroid Build Coastguard Worker IO.mapRequired("client", LoadCommand.client);
485*9880d681SAndroid Build Coastguard Worker }
486*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::sub_framework_command & LoadCommand)487*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::sub_framework_command>::mapping(
488*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::sub_framework_command &LoadCommand) {
489*9880d681SAndroid Build Coastguard Worker
490*9880d681SAndroid Build Coastguard Worker IO.mapRequired("umbrella", LoadCommand.umbrella);
491*9880d681SAndroid Build Coastguard Worker }
492*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::sub_library_command & LoadCommand)493*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::sub_library_command>::mapping(
494*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::sub_library_command &LoadCommand) {
495*9880d681SAndroid Build Coastguard Worker
496*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sub_library", LoadCommand.sub_library);
497*9880d681SAndroid Build Coastguard Worker }
498*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::sub_umbrella_command & LoadCommand)499*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::sub_umbrella_command>::mapping(
500*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::sub_umbrella_command &LoadCommand) {
501*9880d681SAndroid Build Coastguard Worker
502*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sub_umbrella", LoadCommand.sub_umbrella);
503*9880d681SAndroid Build Coastguard Worker }
504*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::symseg_command & LoadCommand)505*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::symseg_command>::mapping(
506*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::symseg_command &LoadCommand) {
507*9880d681SAndroid Build Coastguard Worker
508*9880d681SAndroid Build Coastguard Worker IO.mapRequired("offset", LoadCommand.offset);
509*9880d681SAndroid Build Coastguard Worker IO.mapRequired("size", LoadCommand.size);
510*9880d681SAndroid Build Coastguard Worker }
511*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::symtab_command & LoadCommand)512*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::symtab_command>::mapping(
513*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::symtab_command &LoadCommand) {
514*9880d681SAndroid Build Coastguard Worker
515*9880d681SAndroid Build Coastguard Worker IO.mapRequired("symoff", LoadCommand.symoff);
516*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nsyms", LoadCommand.nsyms);
517*9880d681SAndroid Build Coastguard Worker IO.mapRequired("stroff", LoadCommand.stroff);
518*9880d681SAndroid Build Coastguard Worker IO.mapRequired("strsize", LoadCommand.strsize);
519*9880d681SAndroid Build Coastguard Worker }
520*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::thread_command & LoadCommand)521*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::thread_command>::mapping(
522*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::thread_command &LoadCommand) {}
523*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::twolevel_hints_command & LoadCommand)524*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::twolevel_hints_command>::mapping(
525*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::twolevel_hints_command &LoadCommand) {
526*9880d681SAndroid Build Coastguard Worker
527*9880d681SAndroid Build Coastguard Worker IO.mapRequired("offset", LoadCommand.offset);
528*9880d681SAndroid Build Coastguard Worker IO.mapRequired("nhints", LoadCommand.nhints);
529*9880d681SAndroid Build Coastguard Worker }
530*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::uuid_command & LoadCommand)531*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::uuid_command>::mapping(
532*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::uuid_command &LoadCommand) {
533*9880d681SAndroid Build Coastguard Worker
534*9880d681SAndroid Build Coastguard Worker IO.mapRequired("uuid", LoadCommand.uuid);
535*9880d681SAndroid Build Coastguard Worker }
536*9880d681SAndroid Build Coastguard Worker
mapping(IO & IO,MachO::version_min_command & LoadCommand)537*9880d681SAndroid Build Coastguard Worker void MappingTraits<MachO::version_min_command>::mapping(
538*9880d681SAndroid Build Coastguard Worker IO &IO, MachO::version_min_command &LoadCommand) {
539*9880d681SAndroid Build Coastguard Worker
540*9880d681SAndroid Build Coastguard Worker IO.mapRequired("version", LoadCommand.version);
541*9880d681SAndroid Build Coastguard Worker IO.mapRequired("sdk", LoadCommand.sdk);
542*9880d681SAndroid Build Coastguard Worker }
543*9880d681SAndroid Build Coastguard Worker
544*9880d681SAndroid Build Coastguard Worker } // namespace llvm::yaml
545*9880d681SAndroid Build Coastguard Worker
546*9880d681SAndroid Build Coastguard Worker } // namespace llvm
547