[PATCH] D144079: [AArch64InstPrinter][llvm-objdump] Print ADR PC-relative label as a target address hexadecimal form

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 03:20:11 PST 2023


simon_tatham added a comment.

I think that //most// ideally, if you don't know the true address of the instruction being disassembled, the best way to disassemble ADR is to indicate explicitly that the address you're going to end up with depends on that unknown, and not make it //look// as if it's a constant.

So if you were disassembling a single encoding in the complete absence of any context, you'd write something like `adr x0, .+0x1234` (adjusted as necessary for the representation of 'here' in the assembler syntax you're outputting). And if you're in a context like an object file, where your ADR instruction is at a known offset from the start of the section but the section in turn might end up anywhere in memory after linking, you could say something relative to the section name or to one of the symbols in it, like `adr x0, .text+0x12` or `adr x0, .L.stringliteral`.

But that's a much bigger piece of work, and shouldn't block //this// change, which is a strict improvement on the previous representation!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144079/new/

https://reviews.llvm.org/D144079



More information about the llvm-commits mailing list