From 51fe95ebf7086fb6c221c4a37c64e41019338888 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 22 Dec 2016 22:16:04 +0000 Subject: [PATCH] [ObjectYAML] Fixing big endian bots from r290381 Bot URL: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2505 llvm-svn: 290383 --- test/ObjectYAML/MachO/BigEndian.yaml | 1 - tools/yaml2obj/yaml2macho.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/ObjectYAML/MachO/BigEndian.yaml b/test/ObjectYAML/MachO/BigEndian.yaml index 5e2d1ff2a75..584cd47598b 100644 --- a/test/ObjectYAML/MachO/BigEndian.yaml +++ b/test/ObjectYAML/MachO/BigEndian.yaml @@ -89,7 +89,6 @@ LinkEditData: - '' ... -#CHECK: IsLittleEndian: false #CHECK: FileHeader: #CHECK: magic: 0xFEEDFACE #CHECK: cputype: 0x00000012 diff --git a/tools/yaml2obj/yaml2macho.cpp b/tools/yaml2obj/yaml2macho.cpp index a68d8803772..13414502c03 100644 --- a/tools/yaml2obj/yaml2macho.cpp +++ b/tools/yaml2obj/yaml2macho.cpp @@ -358,7 +358,7 @@ void writeNListEntry(MachOYAML::NListEntry &NLE, raw_ostream &OS, ListEntry.n_desc = NLE.n_desc; ListEntry.n_value = NLE.n_value; - if (sys::IsBigEndianHost) + if (IsLittleEndian != sys::IsLittleEndianHost) MachO::swapStruct(ListEntry); OS.write(reinterpret_cast(&ListEntry), sizeof(NListType)); }