[PATCH] D56480: [llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 10 02:25:41 PST 2019


jhenderson added inline comments.


================
Comment at: test/tools/llvm-objcopy/COFF/strip-unneeded.yaml:1
+# RUN: yaml2obj %s > %t.in.o
+
----------------
The ELF side of llvm-objcopy also strips undefined local symbols that are unreferenced with --strip-unneeded. Should that be the same in COFF?


================
Comment at: test/tools/llvm-objcopy/COFF/strip-unneeded.yaml:8-9
+
+# Despite the name, --discard-all (-x) also only removes unreferenced
+# local symbols.
+
----------------
Just to confirm, this is what GNU objcopy does? The ELF side attempts to strip local symbols in this case whether they're referenced or not.

Another difference between the two is that undefined locals are stripped by strip-unneeded, but not discard-all.


================
Comment at: test/tools/llvm-objcopy/COFF/strip-unneeded.yaml:11
+
+# RUN: llvm-objcopy --discard-all %t.in.o %t.out.o
+# RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS
----------------
I have a marginal preference to use a different output file name for each case. This allows a user to inspect the corresponding output file, should the need arise, without having to mess about with the test.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56480





More information about the llvm-commits mailing list