[llvm-objcopy] Add --only-keep-alloc option to remove all non-allocated sections
ClosedPublic

Authored by jakehehrlich on Fri, Nov 10, 3:02 PM.

Details

Summary

This change adds a new flag not present in GNU objcopy that I call --only-keep-alloc.

Diff Detail

Repository
rL LLVM
jakehehrlich created this revision.Fri, Nov 10, 3:02 PM
jakehehrlich added a subscriber: llvm-commits.

Test case?

tools/llvm-objcopy/llvm-objcopy.cpp
86 ↗(On Diff #122536)

I feel like "strip-nonalloc" (or "strip-non-alloc") would be a better option name, personally, as it's more consistent with other options.

  1. Added test (derp, it turns out I wrote it but didn't run git add on it so it didn't make it into the diff)
  2. renamed "only-keep-alloc" with "strip-non-alloc" everywhere.
This revision is now accepted and ready to land.Tue, Nov 14, 2:26 AM
This revision was automatically updated to reflect the committed changes.