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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 10:05:20 PDT 2019


pcc added a comment.

In D58426#1433713 <https://reviews.llvm.org/D58426#1433713>, @jakehehrlich wrote:

> For your use case you can simply traverse the program headers for each to see if a section is indeed loadable. e.g. you want to strip all non-loadable allocated sections. That seems like a good thing but this probably isn't the right way to handle it IMO.


That's basically what the code ends up doing (via the call to sectionInSegment here: http://llvm-cs.pcc.me.uk/tools/llvm-objcopy/ELF/Object.cpp#920 ; the ParentSegment field is used here: https://github.com/pcc/llvm-project/blob/458fc008993a572c290f2742f349c1ba7c232b2f/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp#L442 ). I'm not sure what other way you had in mind.


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