From e8e7555b10bc38ca54f5986a9840b4ab397bf604 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 25 May 2016 17:09:07 +0000 Subject: [obj2yaml] [yaml2obj] MachO support for rebase opcodes This is the first bit of support for MachO __LINKEDIT segment data. llvm-svn: 270724 --- llvm/lib/ObjectYAML/MachOYAML.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp') diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index 2b4cfa0ce47..641e27e43f7 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -93,9 +93,22 @@ void MappingTraits::mapping(IO &IO, } IO.mapRequired("FileHeader", Object.Header); IO.mapOptional("LoadCommands", Object.LoadCommands); + IO.mapOptional("LinkEditData", Object.LinkEdit); IO.setContext(nullptr); } +void MappingTraits::mapping(IO &IO, + MachOYAML::LinkEditData &LinkEditData) { + IO.mapOptional("RebaseOpcodes", LinkEditData.RebaseOpcodes); +} + +void MappingTraits::mapping(IO &IO, + MachOYAML::RebaseOpcode &RebaseOpcode) { + IO.mapRequired("Opcode", RebaseOpcode.Opcode); + IO.mapRequired("Imm", RebaseOpcode.Imm); + IO.mapOptional("ExtraData", RebaseOpcode.ExtraData); +} + template void mapLoadCommandData(IO &IO, MachOYAML::LoadCommand &LoadCommand) {} -- cgit v1.2.3