diff options
| author | Tim Northover <tnorthover@apple.com> | 2018-05-30 09:54:59 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2018-05-30 09:54:59 +0000 |
| commit | d8949f5002fdedb69cba510c9c676eed890905d1 (patch) | |
| tree | 866a73bc67e2dcaaab591d4e5758d1bc5cc93b5e | |
| parent | bdf09fe7a27f5c17316db42f068bedc04913b596 (diff) | |
| download | bcm5719-llvm-d8949f5002fdedb69cba510c9c676eed890905d1.tar.gz bcm5719-llvm-d8949f5002fdedb69cba510c9c676eed890905d1.zip | |
AArch64: print correct annotation for ADRP addresses.
The immediate on an ADRP MCInst needs to be multiplied by 0x1000 to obtain the
actual PC-offset that will be calculated.
llvm-svn: 333525
| -rw-r--r-- | llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp | 4 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/adrp-annotation.s | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp b/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp index 19d0ba2e1c4..6e64fc9347b 100644 --- a/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp +++ b/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp @@ -99,8 +99,8 @@ bool AArch64ExternalSymbolizer::tryAddingSymbolicOperand( EncodedInst |= MCRI.getEncodingValue(MI.getOperand(0).getReg()); // reg SymbolLookUp(DisInfo, EncodedInst, &ReferenceType, Address, &ReferenceName); - CommentStream << format("0x%llx", - 0xfffffffffffff000LL & (Address + Value)); + CommentStream << format("0x%llx", (0xfffffffffffff000LL & Address) + + Value * 0x1000); } else if (MI.getOpcode() == AArch64::ADDXri || MI.getOpcode() == AArch64::LDRXui || MI.getOpcode() == AArch64::LDRXl || diff --git a/llvm/test/MC/AArch64/adrp-annotation.s b/llvm/test/MC/AArch64/adrp-annotation.s new file mode 100644 index 00000000000..d3a752bd23e --- /dev/null +++ b/llvm/test/MC/AArch64/adrp-annotation.s @@ -0,0 +1,9 @@ +; RUN: llvm-mc -triple aarch64-apple-ios %s -filetype=obj -o %t.o +; RUN: llvm-objdump -macho -d %t.o | FileCheck %s + + .data_region + .space 0x4124 + .end_data_region + + ; CHECK: 4124{{.*}}adrp x0, 5 ; 0x9000 + adrp x0, #0x5000 |

