From be8bc3cf43f07f68d89c82db45e29f63b432ceb5 Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Fri, 5 Apr 2024 10:59:32 +0200 Subject: Revert "[llvm-objcopy] Add --compress-sections" This reverts commit 9e3b64b9f95aadf57568576712902a272fe66503. Reason: Broke the UBSan buildbot. See the comments in the pull request (https://github.com/llvm/llvm-project/pull/85036) for more information. --- llvm/tools/llvm-objcopy/ObjcopyOptions.cpp | 36 ------------------------------ 1 file changed, 36 deletions(-) (limited to 'llvm/tools/llvm-objcopy/ObjcopyOptions.cpp') diff --git a/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp b/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp index 70e8546..7269c51 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp +++ b/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp @@ -736,42 +736,6 @@ objcopy::parseObjcopyOptions(ArrayRef RawArgsArr, return createStringError(errc::invalid_argument, Reason); } - for (const auto *A : InputArgs.filtered(OBJCOPY_compress_sections)) { - SmallVector Fields; - StringRef(A->getValue()).split(Fields, '='); - if (Fields.size() != 2 || Fields[1].empty()) { - return createStringError( - errc::invalid_argument, - A->getSpelling() + - ": parse error, not 'section-glob=[none|zlib|zstd]'"); - } - - auto Type = StringSwitch(Fields[1]) - .Case("zlib", DebugCompressionType::Zlib) - .Case("zstd", DebugCompressionType::Zstd) - .Default(DebugCompressionType::None); - if (Type == DebugCompressionType::None && Fields[1] != "none") { - return createStringError( - errc::invalid_argument, - "invalid or unsupported --compress-sections format: %s", - A->getValue()); - } - - auto &P = Config.compressSections.emplace_back(); - P.second = Type; - auto Matcher = - NameOrPattern::create(Fields[0], SectionMatchStyle, ErrorCallback); - // =none allows overriding a previous =zlib or =zstd. Reject negative - // patterns, which would be confusing. - if (Matcher && !Matcher->isPositiveMatch()) { - return createStringError( - errc::invalid_argument, - "--compress-sections: negative pattern is unsupported"); - } - if (Error E = P.first.addMatcher(std::move(Matcher))) - return std::move(E); - } - Config.AddGnuDebugLink = InputArgs.getLastArgValue(OBJCOPY_add_gnu_debuglink); // The gnu_debuglink's target is expected to not change or else its CRC would // become invalidated and get rejected. We can avoid recalculating the -- cgit v1.1