[PATCH] D78474: [llvm-objcopy][MachO] Make --remove-section clean up dead symbols

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 17:55:02 PDT 2020


smeenai added a comment.

The Mach-O bits look good to me.



================
Comment at: llvm/tools/llvm-objcopy/MachO/Object.cpp:30
+  for (LoadCommand &LC : LoadCommands) {
+    auto It = std::stable_partition(
+        std::begin(LC.Sections), std::end(LC.Sections),
----------------
alexshap wrote:
> smeenai wrote:
> > This is gonna reorder the actual section load commands, right? Is that okay?
> this could be "remove_if" if "remove_if" didn't modify the elements.
> https://en.cppreference.com/w/cpp/algorithm/remove
> https://en.cppreference.com/w/cpp/algorithm/stable_partition
> https://iterator.wordpress.com/2016/01/31/algorithms_0/ .
> Quite the opposite - with std::stable_partition we preserve the order of sections which have not been removed.
Right, makes sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78474





More information about the llvm-commits mailing list