Index: llvm/trunk/test/tools/llvm-objdump/ARM/macho-reloc-half.test =================================================================== --- llvm/trunk/test/tools/llvm-objdump/ARM/macho-reloc-half.test +++ llvm/trunk/test/tools/llvm-objdump/ARM/macho-reloc-half.test @@ -0,0 +1,4 @@ +RUN: llvm-objdump -r %p/Inputs/reloc-half.obj.macho-arm | FileCheck %s + +CHECK-DAG: 00000004 ARM_RELOC_HALF :upper16:(_stringbuf) +CHECK-DAG: 00000000 ARM_RELOC_HALF :lower16:(_stringbuf) Index: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp @@ -1032,7 +1032,7 @@ 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:(";