llvm.org GIT mirror llvm / cd541ea
Let --discard-all imply --strip-debug. This will match gnu strip's behavior. Differential Revision: https://reviews.llvm.org/D61092 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359887 91177308-0d34-0410-b5e6-96231b3b80d8 Sid Manning 5 months ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 # RUN: cp %p/Inputs/dwarf.dwo %t
1 # RUN: llvm-strip --keep-symbol=.L.str --discard-all %t -o %t1
2 # RUN: llvm-readobj --file-headers --sections %t1 | FileCheck --implicit-check-not=.debug_ %s
3 # RUN: llvm-objcopy --keep-symbol=.L.str --discard-all %t %t2
4 # RUN: llvm-readobj --file-headers --sections %t2 | FileCheck --implicit-check-not=.debug_ %s
583583 Config.KeepFileSymbols = InputArgs.hasArg(OBJCOPY_keep_file_symbols);
584584 Config.DecompressDebugSections =
585585 InputArgs.hasArg(OBJCOPY_decompress_debug_sections);
586 if (Config.DiscardMode == DiscardType::All)
587 Config.StripDebug = true;
586588 for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbol))
587589 Config.SymbolsToLocalize.emplace_back(Arg->getValue(), UseRegex);
588590 for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbols))
752754 !Config.StripAllGNU && Config.SymbolsToRemove.empty())
753755 Config.StripAll = true;
754756
757 if (Config.DiscardMode == DiscardType::All)
758 Config.StripDebug = true;
759
755760 Config.DeterministicArchives =
756761 InputArgs.hasFlag(STRIP_enable_deterministic_archives,
757762 STRIP_disable_deterministic_archives, /*default=*/true);