[PATCH] D97766: [objdump][ARM] Use correct offset when printing ARM/Thumb branch targets

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 05:58:28 PST 2021


ostannard created this revision.
ostannard added reviewers: jhenderson, yabinc, srhines, simon_tatham.
Herald added subscribers: danielkiss, rupprecht, hiraditya, kristof.beyls, emaste.
Herald added a reviewer: MaskRay.
ostannard requested review of this revision.
Herald added a project: LLVM.

llvm-objdump only uses one MCInstrAnalysis object, so if ARM and Thumb
code is mixed in one object, or if an object is disassembled without
explicitly setting the triple to match the ISA used, then branch and
call targets will be printed incorrectly.

This could be fixed by creating two MCInstrAnalysis objects in
llvm-objdump, like we currently do for SubtargetInfo. However, I don't
think there's any reason we need two separate sub-classes of
MCInstrAnalysis, so instead these can be merged into one, and the ISA
determined by checking the opcode of the instruction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97766

Files:
  llvm/lib/Target/ARM/ARMInstrInfo.td
  llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
  llvm/test/tools/llvm-objdump/ELF/ARM/branch-symbols.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97766.327425.patch
Type: text/x-patch
Size: 6261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210302/baf899ab/attachment.bin>


More information about the llvm-commits mailing list