[llvm-bugs] [Bug 35966] Branch targets in BPF disassembler listing	are incorrect
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Tue Jul 24 05:46:22 PDT 2018
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=35966
Jiong Wang <jiong.wang at netronome.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED
--- Comment #2 from Jiong Wang <jiong.wang at netronome.com> ---
The disassembly for branch target has been improved a little bit by
commit 7a07b064e95d464a7192a4ea78ad902e232b9604
Author: Yonghong Song <yhs at fb.com>
Date:   Thu Nov 16 19:15:36 2017 +0000
    bpf: print backward branch target properly
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318442
91177308-0d34-0410-b5e6-96231b3b80d8
llvm-objdump will output something like the following for backward and forward
branch accordingly:
  backward: if r2 s> r3 goto -10
  forward: if r4 s>= r3 goto +11
pc-relative address/index is printed instead of absolute address/index. This is
inconsistent with kernel verifier disassembly format.
There is one place we could potentially improve though, it is when there is not
symbol information that llvm-objdump will also annotate the branch target with
it's section relative address:
   if r2 s> r1 goto +7 <.text+0xd8>
This address however is not turned into index which is used in all other
places, this might be a little bit confusing to people. To improve this, needs
modification on llvm-objdump generic code, might be not worth doing that.
Based on above explanation, I think the current disassembly output for branch
target is expected.
-- 
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/20180724/abbe0a93/attachment.html>
    
    
More information about the llvm-bugs
mailing list