From 55de3a2449ae2f914c0dbc0a25627e04bcf21a05 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 22 Dec 2016 21:58:03 +0000 Subject: [ObjectYAML] MachO support for endianness This patch adds support to the macho<->yaml tools for preserving endianness in MachO structures and DWARF data. llvm-svn: 290381 --- llvm/lib/ObjectYAML/MachOYAML.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp') diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index 7ebb1bed088..a033a79189b 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -14,6 +14,7 @@ #include "llvm/ObjectYAML/MachOYAML.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Format.h" +#include "llvm/Support/Host.h" #include "llvm/Support/MachO.h" #include // For memcpy, memset and strnlen. @@ -100,6 +101,10 @@ void MappingTraits::mapping(IO &IO, IO.setContext(&Object); } IO.mapTag("!mach-o", true); + IO.mapOptional("IsLittleEndian", Object.IsLittleEndian, + sys::IsLittleEndianHost); + Object.DWARF.IsLittleEndian = Object.IsLittleEndian; + IO.mapRequired("FileHeader", Object.Header); IO.mapOptional("LoadCommands", Object.LoadCommands); if(!Object.LinkEdit.isEmpty() || !IO.outputting()) -- cgit v1.2.3