[llvm-bugs] [Bug 49386] New: llvm-objdump doesn't show branch target properly for arm binaries

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 1 17:15:24 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49386

            Bug ID: 49386
           Summary: llvm-objdump doesn't show branch target properly for
                    arm binaries
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-objdump
          Assignee: unassignedbugs at nondot.org
          Reporter: yabinc at google.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24580
  --> https://bugs.llvm.org/attachment.cgi?id=24580&action=edit
arm binary and disassembly outputs

It seems llvm-objdump have problem showing branch target properly for arm
binaries. Below is an example:

$ arm-linux-androideabi-objdump  -dlC --no-show-raw-insn --start-address=0x784
--stop-address=0x7d4  simpleperf_runtest_two_functions_arm

00000784 <main>:
...
system/extras/simpleperf/runtest/two_functions.cpp:9
     7a6:       str.w   r1, [r7, r0, lsl #2]
system/extras/simpleperf/runtest/two_functions.cpp:8
     7aa:       adds    r1, #1
     7ac:       cmp     r6, r1
     7ae:       bne.n   7a6 <main+0x22>
...

$ llvm-objdump -dlC --no-show-raw-insn --start-address=0x784
--stop-address=0x7d4 --print-imm-hex simpleperf_runtest_two_functions_arm

00000784 <main>:
...
; system/extras/simpleperf/runtest/two_functions.cpp:9
     7a6:       str.w   r1, [r7, r0, lsl #2]
; system/extras/simpleperf/runtest/two_functions.cpp:8
     7aa:       adds    r1, #0x1
     7ac:       cmp     r6, r1
     7ae:       bne     #-0xc <main+0x26>
...

By comparing the output of llvm-objdump and objdump. In the disassembly for
0x7ae:
1. llvm-objdump doesn't show a calculated target address. This is painful to
calculate manually.
2. the correct suffix should be <main+0x22> instead of <main+0x26>.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210302/74dff6e5/attachment-0001.html>


More information about the llvm-bugs mailing list