llvm.org GIT mirror llvm / 8ca723a
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307882 91177308-0d34-0410-b5e6-96231b3b80d8 Martin Storsjo 3 years ago
3 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 RUN: llvm-objdump -r %p/Inputs/reloc-half.obj.macho-arm | FileCheck %s
1
2 CHECK-DAG: 00000004 ARM_RELOC_HALF :upper16:(_stringbuf)
3 CHECK-DAG: 00000000 ARM_RELOC_HALF :lower16:(_stringbuf)
10311031 case MachO::ARM_RELOC_HALF_SECTDIFF: {
10321032 // Half relocations steal a bit from the length field to encode
10331033 // whether this is an upper16 or a lower16 relocation.
1034 bool isUpper = Obj->getAnyRelocationLength(RE) >> 1;
1034 bool isUpper = (Obj->getAnyRelocationLength(RE) & 0x1) == 1;
10351035
10361036 if (isUpper)
10371037 fmt << ":upper16:(";