[PATCH] D61092: [llvm-strip] Have --discard-all imply --strip-debug
Sid Manning via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 25 09:45:43 PDT 2019
sidneym updated this revision to Diff 196661.
sidneym added a comment.
Update testcase.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61092/new/
https://reviews.llvm.org/D61092
Files:
test/tools/llvm-objcopy/ELF/discard-all-debug.test
tools/llvm-objcopy/CopyConfig.cpp
Index: tools/llvm-objcopy/CopyConfig.cpp
===================================================================
--- tools/llvm-objcopy/CopyConfig.cpp
+++ tools/llvm-objcopy/CopyConfig.cpp
@@ -740,6 +740,9 @@
Config.DiscardMode == DiscardType::None && !Config.StripAllGNU && Config.SymbolsToRemove.empty())
Config.StripAll = true;
+ if (Config.DiscardMode == DiscardType::All)
+ Config.StripDebug = true;
+
Config.DeterministicArchives =
InputArgs.hasFlag(STRIP_enable_deterministic_archives,
STRIP_disable_deterministic_archives, /*default=*/true);
Index: test/tools/llvm-objcopy/ELF/discard-all-debug.test
===================================================================
--- /dev/null
+++ test/tools/llvm-objcopy/ELF/discard-all-debug.test
@@ -0,0 +1,5 @@
+# RUN: cp %p/Inputs/dwarf.dwo %t
+# RUN: llvm-strip --keep-symbol=.L.str --discard-all %t
+# RUN: llvm-readobj --file-headers --sections %t | FileCheck --implicit-check-not=.debug_ %s
+
+CHECK: SectionHeaderCount: 8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61092.196661.patch
Type: text/x-patch
Size: 1031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190425/2e9b16b5/attachment.bin>
More information about the llvm-commits
mailing list