Expose objcopy's --discard-all option in llvm-strip.
Test plan: make check-all
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/tools/llvm-objcopy/discard-all.test | ||
---|---|---|
14 ↗ | (On Diff #149884) | Why is the -d here? Could you also test -x with llvm-strip, please? |
test/tools/llvm-objcopy/discard-all.test | ||
---|---|---|
14 ↗ | (On Diff #149884) |
@jhenderson - otherwise strip will remove the symbol table and we won't be able to test how it's getting modified. |
First, thanks for the patch :)
I think @jhenderson pointed out something important. If you do strip -x foo -o bar, you will notice that it will only discard local symbols from the binary.
This is not really what's happening with this behavior.. (as you mentioned, this removes symbol table, and that's why you can't test the -x option alone)
Maybe we should fix this ? What do you think ? :)
tools/llvm-objcopy/llvm-objcopy.cpp | ||
---|---|---|
588–589 ↗ | (On Diff #149884) | Maybe you should do something like (see my comment above for the reason): Config.DiscardAll = InputArgs.hasArg(STRIP_discard_all); if (!Config.StripDebug && !Config.DiscardAll) Config.StripAll = true; |
591–592 ↗ | (On Diff #149884) | And thus remove those lines :) |
LGTM. I think the updated version makes a lot more sense (why discard the local symbols if you are going to remove the symbol table anyway?).