[PATCH] D58027: [llvm-objcopy] Add --strip-unneeded-symbol(s)

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 05:00:26 PST 2019

mstorsjo added inline comments.

Comment at: test/tools/llvm-objcopy/ELF/strip-unneeded.test:29
+# RUN: llvm-objcopy --regex --strip-unneeded-symbols %t.list2.txt %t %t6
+# RUN: cmp %t2 %t6
evgeny777 wrote:
> mstorsjo wrote:
> > All the newly added tests produce results identical to some of the existing tests, removing all symbols. Wouldn't it be useful with a test that only removes some of the unneeded symbols but not all of them, to showcase the difference?
> --strip-unneeded removes only bar, foobar and foobaz. File and section symbols are not removed, also foo is not removed because it's in comdat. This is checked by original test case (line 6). Additional tests check that
> 1. Unneeded symbols are removed, but not STT_FILE / STT_SECTON nor comdat (%t3)
> 2. Stripping all symbols by regex pattern .* is identical to ---strip-unneeded (%t4)
> 3. Stripping just bar, foobar and foobaz is identical to --strip-unneeded, because all others should be preserved (%t5)
> 4. The %t6 is identical to %t4, but using a file
> What kind of extra test do you feel is needed?
A test that removes only one of bar/foobar/foobaz but not all of them.



More information about the llvm-commits mailing list