[PATCH] D66282: [llvm-objcopy][MachO] Implement --remove-section

Seiya Nuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 00:20:20 PDT 2019


seiya marked an inline comment as done.
seiya added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp:42-46
   if (!Config.OnlySection.empty()) {
     RemovePred = [&Config, RemovePred](const Section &Sec) {
       return !Config.OnlySection.matches(Sec.CanonicalName);
     };
   }
----------------
rupprecht wrote:
> rupprecht wrote:
> > Not related to this patch, but looks like this discards `RemovePred`, e.g. `--strip-all --only-section` will effectively work like `--only-section`.
> > 
> > I found this after noticing that `RemovePred` is not referenced in the bit you added, which is actually fine there but error prone if the iterative construction of `RemovePred` is ever reordered. ELF objcopy works like this too, but correctly chains `RemovePred` for the `--only-section` switch.
> Nevermind, that flag takes priority, so that's WAI. Ignore this comment.
I'll add a comment for it. It's worth mentioning in the code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66282





More information about the llvm-commits mailing list