<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - llvm-objdump doesn't show branch target properly for arm binaries"
   href="https://bugs.llvm.org/show_bug.cgi?id=49386">49386</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-objdump doesn't show branch target properly for arm binaries
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llvm-objdump
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yabinc@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24580" name="attach_24580" title="arm binary and disassembly outputs">attachment 24580</a> <a href="attachment.cgi?id=24580&action=edit" title="arm binary and disassembly outputs">[details]</a></span>
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>.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>