From fa5183b0280fe0d0bc44f1bbc8f24d744013e31b Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 13 Jul 2017 05:54:08 +0000 Subject: [llvm-objdump] Correctly distinguish between the MachO upper/lower16 relocations All other code in MachODump.cpp uses the same comparison, ((r_length & 0x1) == 1), for distinguishing between the two, while the code in llvm-objdump.cpp seemed to be incorrect. Differential Revision: https://reviews.llvm.org/D35240 llvm-svn: 307882 --- llvm/tools/llvm-objdump/llvm-objdump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp') diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index be5635a3d4c..812f1af3ac6 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1032,7 +1032,7 @@ static std::error_code getRelocationValueString(const MachOObjectFile *Obj, case MachO::ARM_RELOC_HALF_SECTDIFF: { // Half relocations steal a bit from the length field to encode // whether this is an upper16 or a lower16 relocation. - bool isUpper = Obj->getAnyRelocationLength(RE) >> 1; + bool isUpper = (Obj->getAnyRelocationLength(RE) & 0x1) == 1; if (isUpper) fmt << ":upper16:("; -- cgit v1.2.3