[PATCH] D49979: [llvm-objcopy] Add --dump-section

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 02:52:20 PDT 2018


jhenderson added a comment.

In https://reviews.llvm.org/D49979#1183640, @jakehehrlich wrote:

> So here's an idea. It is ELF specific but it extends the SectionBase interface in a way I've considered for a while and would make both this and another change quite easy. If we add an OriginalData field (ArrayRef<uint8_t>) to SectionBase we can dump that inside of HandleArgs.


My first instinct on looking at the code as I considered this is that this should be handled in a way similar to how `SplitDWOToFile` works, i.e. to do it at the start of HandleArgs before any manipulation of `Object` takes place. I think this would mean that we wouldn't need any additional methods, because it would happen before any modifications occurred. And we have `ELFSectionWriter` that would achieve what we want, I believe? So just create a specific ELFSectionWriter for the dumping of sections and use that.

I'm not completely opposed to using another method to do it, but it seems like anything else we do would just add additional complexity?


Repository:
  rL LLVM

https://reviews.llvm.org/D49979





More information about the llvm-commits mailing list