[PATCH] D77580: [llvm-objdump] Fix incomplete relocation output for -D -r mode

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 12:32:19 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1589
             // Stop when RelCur's offset is past the current instruction.
             if (Offset >= Index + Size)
               break;
----------------
jasonliu wrote:
> hubert.reinterpretcast wrote:
> > hubert.reinterpretcast wrote:
> > > I think XCOFF32 is working because the pointer length is the same as the instruction length?
> > This was mainly a comment about how the output would be displayed. The status quo (relocation prints "in the middle") felt weird to me, but I have now found that it matches the binutils `objdump` output.
> > ```
> > 00000000000000c8 <main>:
> >   c8:   00 00 00 00     .long 0x0
> >                         c8: R_POS_64    .main
> >   cc:   00 00 00 00     .long 0x0
> > ```
> > 
> > Should we add a comment that this checks only the start of the relocation (and not its end) on purpose?
> Thanks. Comment added. 
> This was mainly a comment about how the output would be displayed. The status quo (relocation prints "in the middle") felt weird to me, but I have now found that it matches the binutils objdump output.

I think the idea is that the relocations that may modify the instruction are printed after the instruction.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77580/new/

https://reviews.llvm.org/D77580





More information about the llvm-commits mailing list