Let --discard-all imply --strip-debug.
This will match gnu strip's behavior. Differential Revision: https://reviews.llvm.org/D61092 llvm-svn: 359887
This commit is contained in:
parent
4d4f779fa2
commit
5ad18a7d59
|
@ -0,0 +1,5 @@
|
||||||
|
# RUN: cp %p/Inputs/dwarf.dwo %t
|
||||||
|
# RUN: llvm-strip --keep-symbol=.L.str --discard-all %t -o %t1
|
||||||
|
# RUN: llvm-readobj --file-headers --sections %t1 | FileCheck --implicit-check-not=.debug_ %s
|
||||||
|
# RUN: llvm-objcopy --keep-symbol=.L.str --discard-all %t %t2
|
||||||
|
# RUN: llvm-readobj --file-headers --sections %t2 | FileCheck --implicit-check-not=.debug_ %s
|
|
@ -584,6 +584,8 @@ Expected<DriverConfig> parseObjcopyOptions(ArrayRef<const char *> ArgsArr) {
|
||||||
Config.KeepFileSymbols = InputArgs.hasArg(OBJCOPY_keep_file_symbols);
|
Config.KeepFileSymbols = InputArgs.hasArg(OBJCOPY_keep_file_symbols);
|
||||||
Config.DecompressDebugSections =
|
Config.DecompressDebugSections =
|
||||||
InputArgs.hasArg(OBJCOPY_decompress_debug_sections);
|
InputArgs.hasArg(OBJCOPY_decompress_debug_sections);
|
||||||
|
if (Config.DiscardMode == DiscardType::All)
|
||||||
|
Config.StripDebug = true;
|
||||||
for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbol))
|
for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbol))
|
||||||
Config.SymbolsToLocalize.emplace_back(Arg->getValue(), UseRegex);
|
Config.SymbolsToLocalize.emplace_back(Arg->getValue(), UseRegex);
|
||||||
for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbols))
|
for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbols))
|
||||||
|
@ -753,6 +755,9 @@ Expected<DriverConfig> parseStripOptions(ArrayRef<const char *> ArgsArr) {
|
||||||
!Config.StripAllGNU && Config.SymbolsToRemove.empty())
|
!Config.StripAllGNU && Config.SymbolsToRemove.empty())
|
||||||
Config.StripAll = true;
|
Config.StripAll = true;
|
||||||
|
|
||||||
|
if (Config.DiscardMode == DiscardType::All)
|
||||||
|
Config.StripDebug = true;
|
||||||
|
|
||||||
Config.DeterministicArchives =
|
Config.DeterministicArchives =
|
||||||
InputArgs.hasFlag(STRIP_enable_deterministic_archives,
|
InputArgs.hasFlag(STRIP_enable_deterministic_archives,
|
||||||
STRIP_disable_deterministic_archives, /*default=*/true);
|
STRIP_disable_deterministic_archives, /*default=*/true);
|
||||||
|
|
Loading…
Reference in New Issue