[PATCH] D74824: [objdump] Fix disassembly for call/branch instructions for ELF binaries built with -ffunction-sections
    Fangrui Song via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Feb 27 10:22:16 PST 2020
    
    
  
MaskRay added a comment.
I think symbolizing an undefined symbol as if it is defined is fine.
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1463
+              if (Name)
+                printBranchTarget(*Name, 0 /* would expect this to be symbol addend? */);
+          }
----------------
Addends may be important for "range extension thunks with addends"
https://bugs.llvm.org/show_bug.cgi?id=40438
I think a sensible approach is to shift r_addend as if r_offset is moved to the start address of the instruction.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74824/new/
https://reviews.llvm.org/D74824
    
    
More information about the llvm-commits
mailing list