[llvm-dev] [llvm-objdump] pc-relative branches output immediate value instead of target address

Sergio PĂ©rez via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 13 09:22:16 PST 2019


Hello All,

While using llvm-objdump I noticed that for the pc-rel branching
instructions (jmp/br/call) it prints the immediate value encoded in the
instruction, as opposed to the target address like binutils does.
I've created a patch (https://reviews.llvm.org/D71453) that tries to match
the output of those instructions with binutils, my first attempt to
contribute. Since I modify the target specific 'InstPrinter's I only did it
(initially) for the targets that have llvm-objdump tests, and also I assume
InstPrinter might be used in more components other than objdump, therefore
I would like to kindly ask for you feedback.

E.g.

Binutils:
4005af: 0f 8f 35 00 00 00     jg     4005ea <main+0x8a>

llvm-objdump (currently):
4005af: 0f 8f 35 00 00 00             jg 0x35 <main+0x8a>

Best regards,
Sergio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191213/b8920191/attachment.html>


More information about the llvm-dev mailing list