diff options
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r-- | llvm/lib/ObjectYAML/MachOYAML.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index b98d4622a36..6724b24dd33 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -110,6 +110,10 @@ void MappingTraits<MachOYAML::LoadCommand>::mapping( switch (LoadCommand.Data.load_command_data.cmd) { #include "llvm/Support/MachO.def" } + if (LoadCommand.Data.load_command_data.cmd == MachO::LC_SEGMENT || + LoadCommand.Data.load_command_data.cmd == MachO::LC_SEGMENT_64) { + IO.mapOptional("Sections", LoadCommand.Sections); + } } void MappingTraits<MachO::dyld_info_command>::mapping( @@ -124,6 +128,22 @@ void MappingTraits<MachO::dyld_info_command>::mapping( IO.mapRequired("export_size", LoadCommand.export_size); } +void MappingTraits<MachOYAML::Section>::mapping(IO &IO, + MachOYAML::Section &Section) { + IO.mapRequired("sectname", Section.sectname); + IO.mapRequired("segname", Section.segname); + IO.mapRequired("addr", Section.addr); + IO.mapRequired("size", Section.size); + IO.mapRequired("offset", Section.offset); + IO.mapRequired("align", Section.align); + IO.mapRequired("reloff", Section.reloff); + IO.mapRequired("nreloc", Section.nreloc); + IO.mapRequired("flags", Section.flags); + IO.mapRequired("reserved1", Section.reserved1); + IO.mapRequired("reserved2", Section.reserved2); + IO.mapOptional("reserved3", Section.reserved3); +} + void MappingTraits<MachO::dylib>::mapping(IO &IO, MachO::dylib &DylibStruct) { IO.mapRequired("name", DylibStruct.name); IO.mapRequired("timestamp", DylibStruct.timestamp); |