Skip to content

Commit 6d92ea4

Browse files
committed
review: add ELF block to denote unhandled option
1 parent 40d7e57 commit 6d92ea4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

llvm/include/llvm/ObjCopy/ConfigManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct LLVM_ABI ConfigManager : public MultiFormatConfig {
2727

2828
const CommonConfig &getCommonConfig() const override { return Common; }
2929

30-
Expected<const ELFConfig &> getELFConfig() const override { return ELF; }
30+
Expected<const ELFConfig &> getELFConfig() const override;
3131

3232
Expected<const COFFConfig &> getCOFFConfig() const override;
3333

llvm/lib/ObjCopy/ConfigManager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
using namespace llvm;
1414
using namespace llvm::objcopy;
1515

16+
Expected<const ELFConfig &> ConfigManager::getELFConfig() const {
17+
if (!Common.ExtractSection.empty())
18+
return createStringError(llvm::errc::invalid_argument,
19+
"option is not supported for ELF");
20+
return ELF;
21+
}
22+
1623
Expected<const COFFConfig &> ConfigManager::getCOFFConfig() const {
1724
if (!Common.SplitDWO.empty() || !Common.SymbolsPrefix.empty() ||
1825
!Common.SymbolsPrefixRemove.empty() || !Common.SymbolsToSkip.empty() ||

0 commit comments

Comments
 (0)