[PATCH] D63185: [llvm-objcopy] [WIP] Librarify llvm-objcopy

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 02:31:50 PDT 2019


jhenderson added a comment.

At least with renaming a section, what is stopping you just modifying `SectionBase.Name`?

More generally, I guess I don't understand why you need to make a copy of a section when you want to update it rather than just modifying it in-place?

Also, I'd steer away from a single Object base class that is intended to be shared between formats. There's a good reason why we don't do this in llvm-objcopy currently: the file formats are different enough that trying to have a common interface is messy.

My feeling is that you should focus on the structure required to make changes and then lay out a file to be written. If you look at how llvm-objcopy was originally developed, it started off as just doing enough to copy everything, and then hooks were added to allow modifications of different parts as time went on. However, I'm not saying that's the only way to design this, so I'm open to alternatives, if you've got a good reason to do it a different way.


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

https://reviews.llvm.org/D63185





More information about the llvm-commits mailing list