This follows other patches that changed printing immediate values of branch instructions to target addresses, see D76580 (x86), D76591 (PPC), D77853 (AArch64). As observing immediate values might sometimes be useful, they are printed as comments for branch instructions. // llvm-objdump -d output (before) 000200b4 <_start>: 200b4: ff ff ff fa blx #-4 <thumb> 000200b8 <thumb>: 200b8: ff f7 fc ef blx #-8 <_start> // llvm-objdump -d output (after) 000200b4 <_start>: 200b4: ff ff ff fa blx 0x200b8 <thumb> @ imm = #-4 000200b8 <thumb>: 200b8: ff f7 fc ef blx 0x200b4 <_start> @ imm = #-8 // GNU objdump -d. 000200b4 <_start>: 200b4: faffffff blx 200b8 <thumb> 000200b8 <thumb>: 200b8: f7ff effc blx 200b4 <_start> Differential Revision: https://reviews.llvm.org/D104701
29 lines
835 B
Plaintext
29 lines
835 B
Plaintext
# RUN: yaml2obj %s -o %t
|
|
# RUN: llvm-objdump -D --triple=thumbv8.1m.main-none-eabi %t | FileCheck %s
|
|
|
|
## This is a test case with "random" data/instructions, checking that
|
|
## llvm-objdump handles such instructions cleanly. Disassembly of instructions
|
|
## can fail when it e.g. is not given the right set of architecture features,
|
|
## for example when the source is compiled with:
|
|
##
|
|
## clang -march=..+ext1+ext2
|
|
##
|
|
## and disassembly is attempted with:
|
|
##
|
|
## llvm-objdump --mattr=+ext1
|
|
|
|
# CHECK: 00000000 <.text>:
|
|
# CHECK-NEXT: 0: cb <unknown>
|
|
# CHECK-NEXT: 1: f3 f7 8b be b.w 0xffff3d1b <{{.+}}> @ imm = #-49898
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_ARM
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Content: "cbf3f78bbe"
|