[PATCH] D79038: [objdump][ELF] Handle sections not contained in PT_LOAD segments

LemonBoy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 09:35:58 PDT 2020


LemonBoy added a comment.

> What is actually the difference between them here?

The difference doesn't really matter here as the segment PAddr and VAddr are zero, the test case passes by simply avoiding the `Sec.Addr` assigment for sections with non-PT_LOAD segments, that's why it's been suggested to patch `setParentSegment` and keep the old logic.
The added logic takes into account one more edge case, as explained by this comment in BFD:

  /* We used to use the same adjustment for SEC_LOAD
  		   sections, but that doesn't work if the segment
  		   is packed with code from multiple VMAs.
  		   Instead we calculate the section LMA based on
  		   the segment LMA.  It is assumed that the
  		   segment will contain sections with contiguous
  		   LMAs, even if the VMAs are not.  */

If you prefer a less-invasive patch I can simply go for the `setParentSegment` route.


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

https://reviews.llvm.org/D79038





More information about the llvm-commits mailing list