[PATCH] D58426: llvm-objcopy: Change sectionWithinSegment() to use virtual addresses instead of file offsets.

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 12:47:41 PDT 2019


jakehehrlich added a comment.

I can think of two ways

James Way (which works in all cases I'm aware of without faulty assumptions and should produce the correct result)
0) Return false if a non-allocated NOBITS section is used here

1. If the section is NOBITS use address and check that SectionIsTLS == SegmentIsTLS
2. If the section is not NOBITS disregard SectionIsTLS == SegmentIsTLS and use offset

Another Way:
0) Return false if a non-allocated NOBITS section is used here

1. If allocated use address and check that TLS flags match. We assume that we're in a non ET_REL binary since there's a program header.
2. If non-allocated use offset to account for the case where a segment still covers the section.

Both of those should work. I think I prefer James's way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58426





More information about the llvm-commits mailing list