Index: test/Object/macho-invalid.test =================================================================== --- test/Object/macho-invalid.test +++ test/Object/macho-invalid.test @@ -102,7 +102,7 @@ INVALID-FAT: truncated or malformed fat file (fat_arch_64 structs would extend past the end of the file) RUN: not llvm-objdump --macho --private-headers -arch all %p/Inputs/macho-invalid-fat.obj.elf-x86_64 2>&1 | FileCheck -check-prefix INVALID-FAT-ELF %s -INVALID-FAT-ELF: Mach-O universal file: {{.*}}/macho-invalid-fat.obj.elf-x86_64 for architecture x86_64 is not a Mach-O file or an archive file +INVALID-FAT-ELF: error: '{{.*}}/macho-invalid-fat.obj.elf-x86_64': Mach-O universal file for architecture x86_64 is not a Mach-O file or an archive file. RUN: not llvm-objdump --macho --private-headers %p/Inputs/macho-invalid-segment-fileoff 2>&1 | FileCheck -check-prefix INVALID-SEGMENT-FILEOFF %s INVALID-SEGMENT-FILEOFF: macho-invalid-segment-fileoff': truncated or malformed object (load command 0 fileoff field in LC_SEGMENT extends past the end of the file) Index: test/tools/llvm-objdump/X86/disassemble-functions-mangling.test =================================================================== --- test/tools/llvm-objdump/X86/disassemble-functions-mangling.test +++ test/tools/llvm-objdump/X86/disassemble-functions-mangling.test @@ -20,10 +20,10 @@ # RUN: | FileCheck %s --check-prefix=DEMANGLED-MULTI # MANGLED: _Z3foov: -# MANGLED-MISS: warning: failed to disassemble missing function foo +# MANGLED-MISS: warning: '{{.*}}': failed to disassemble missing function foo # DEMANGLED: foo(): -# DEMANGLED-MISS: warning: failed to disassemble missing function _Z3foov +# DEMANGLED-MISS: warning: '{{.*}}': failed to disassemble missing function _Z3foov # NOMANGLE: i: # NOMANGLE: f: Index: test/tools/llvm-objdump/X86/source-interleave-invalid-source.test =================================================================== --- test/tools/llvm-objdump/X86/source-interleave-invalid-source.test +++ test/tools/llvm-objdump/X86/source-interleave-invalid-source.test @@ -13,6 +13,6 @@ # CHECK: main: # CHECK-NEXT: ; int main() { -# WARN: warning: debug info line number 9999 exceeds the number of lines in {{.*}}source-interleave-x86_64.c +# WARN: warning: '{{.*}}': debug info line number 9999 exceeds the number of lines in {{.*}}source-interleave-x86_64.c # GOOD: ; int *b = &a; # CHECK: ; return *b + foo(); Index: test/tools/llvm-objdump/X86/source-interleave-missing-source.test =================================================================== --- test/tools/llvm-objdump/X86/source-interleave-missing-source.test +++ test/tools/llvm-objdump/X86/source-interleave-missing-source.test @@ -11,7 +11,7 @@ # RUN: llvm-objdump --source %t2.o | FileCheck %s --check-prefixes=CHECK,SOURCE # RUN: FileCheck %s --input-file %t.e --check-prefixes=WARN -# WARN: warning: failed to find source {{.*}}source-interleave-x86_64.c +# WARN: warning: '{{.*}}': failed to find source {{.*}}source-interleave-x86_64.c # CHECK: 0000000000000010 main: # SOURCE-NEXT: ; int main() { # CHECK-NEXT: 10: 55 pushq %rbp Index: test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test =================================================================== --- test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test +++ test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test @@ -9,7 +9,7 @@ # RUN: llvm-objdump --source %t2.o 2> %t2.e | FileCheck %s --check-prefixes=CHECK --implicit-check-not='main()' # RUN: FileCheck %s --input-file %t2.e --check-prefixes=WARN -# WARN: warning: failed to parse debug information for {{.*}}2.o +# WARN: warning: '{{.*}}2.o': failed to parse debug information. # CHECK: 0000000000000010 main: # SOURCE-NEXT: ; int main() { # CHECK-NEXT: 10: 55 pushq %rbp Index: test/tools/llvm-objdump/X86/warn-missing-disasm-func.test =================================================================== --- test/tools/llvm-objdump/X86/warn-missing-disasm-func.test +++ test/tools/llvm-objdump/X86/warn-missing-disasm-func.test @@ -13,9 +13,9 @@ Type: ET_REL Machine: EM_X86_64 -# CHECK: warning: failed to disassemble missing function foo +# CHECK: warning: {{.*}}: failed to disassemble missing function foo. # MULTI: file format ELF64-x86-64 -# MULTI: warning: failed to disassemble missing function foo +# MULTI: warning: {{.*}}: failed to disassemble missing function foo. # MULTI: file format ELF64-x86-64 -# MULTI: warning: failed to disassemble missing function foo +# MULTI: warning: {{.*}}: failed to disassemble missing function foo. Index: test/tools/llvm-objdump/warn-on-out-of-range-start-stop-address.test =================================================================== --- test/tools/llvm-objdump/warn-on-out-of-range-start-stop-address.test +++ test/tools/llvm-objdump/warn-on-out-of-range-start-stop-address.test @@ -120,12 +120,12 @@ ## No warning if neither --start-address nor --stop-address are specified. # RUN: llvm-objdump --file-headers %t 2>&1 | FileCheck %s --implicit-check-not=warning: -# WARN: warning: no section overlaps the range {{.*}} specified by --start-address/--stop-address -# WARN-STOP-ONLY: warning: no section has address less than 0x1000 specified by --stop-address -# WARN-START-ONLY: warning: no section has address greater than or equal to 0x1500 specified by --start-address +# WARN: warning: {{.*}}: no section overlaps the range {{.*}} specified by --start-address/--stop-address +# WARN-STOP-ONLY: warning: {{.*}}: no section has address less than 0x1000 specified by --stop-address +# WARN-START-ONLY: warning: {{.*}}: no section has address greater than or equal to 0x1500 specified by --start-address # MULTI-INPUT: file format -# MULTI-INPUT: warning: no section overlaps the range [0x2001,0x2005) specified by --start-address/--stop-address +# MULTI-INPUT: warning: {{.*}}: no section overlaps the range [0x2001,0x2005) specified by --start-address/--stop-address # MULTI-INPUT: file format # MULTI-INPUT-NOT: warning: Index: tools/llvm-objdump/COFFDump.cpp =================================================================== --- tools/llvm-objdump/COFFDump.cpp +++ tools/llvm-objdump/COFFDump.cpp @@ -234,13 +234,14 @@ if (Count == 0) return; - uint32_t ImageBase = Obj->getPE32Header()->ImageBase; uintptr_t IntPtr = 0; - error(Obj->getVaPtr(TableVA, IntPtr)); + if (std::error_code EC = Obj->getVaPtr(TableVA, IntPtr)) + report_error(errorCodeToError(EC), Obj->getFileName()); + const support::ulittle32_t *P = (const support::ulittle32_t *)IntPtr; outs() << "SEH Table:"; for (int I = 0; I < Count; ++I) - outs() << format(" 0x%x", P[I] + ImageBase); + outs() << format(" 0x%x", P[I] + Obj->getPE32Header()->ImageBase); outs() << "\n\n"; } @@ -274,11 +275,16 @@ return; const data_directory *DataDir; - error(Obj->getDataDirectory(COFF::TLS_TABLE, DataDir)); - uintptr_t IntPtr = 0; + if (std::error_code EC = Obj->getDataDirectory(COFF::TLS_TABLE, DataDir)) + report_error(errorCodeToError(EC), Obj->getFileName()); + if (DataDir->RelativeVirtualAddress == 0) return; - error(Obj->getRvaPtr(DataDir->RelativeVirtualAddress, IntPtr)); + + uintptr_t IntPtr = 0; + if (std::error_code EC = + Obj->getRvaPtr(DataDir->RelativeVirtualAddress, IntPtr)) + report_error(errorCodeToError(EC), Obj->getFileName()); if (PE32Header) { auto *TLSDir = reinterpret_cast(IntPtr); @@ -301,11 +307,18 @@ return; const data_directory *DataDir; - error(Obj->getDataDirectory(COFF::LOAD_CONFIG_TABLE, DataDir)); + + if (std::error_code EC = + Obj->getDataDirectory(COFF::LOAD_CONFIG_TABLE, DataDir)) + report_error(errorCodeToError(EC), Obj->getFileName()); + uintptr_t IntPtr = 0; if (DataDir->RelativeVirtualAddress == 0) return; - error(Obj->getRvaPtr(DataDir->RelativeVirtualAddress, IntPtr)); + + if (std::error_code EC = + Obj->getRvaPtr(DataDir->RelativeVirtualAddress, IntPtr)) + report_error(errorCodeToError(EC), Obj->getFileName()); auto *LoadConf = reinterpret_cast(IntPtr); outs() << "Load configuration:" @@ -447,7 +460,9 @@ llvm::sort(Rels, isRelocAddressLess); ArrayRef Contents; - error(Obj->getSectionContents(Pdata, Contents)); + if (Error E = Obj->getSectionContents(Pdata, Contents)) + report_error(std::move(E), Obj->getFileName()); + if (Contents.empty()) continue; @@ -563,10 +578,12 @@ ArrayRef XContents; uint64_t UnwindInfoOffset = 0; - error(getSectionContents( - Obj, Rels, SectionOffset + - /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8, - XContents, UnwindInfoOffset)); + if (Error E = getSectionContents( + Obj, Rels, + SectionOffset + + /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8, + XContents, UnwindInfoOffset)) + report_error(std::move(E), Obj->getFileName()); if (XContents.empty()) return; @@ -642,9 +659,12 @@ void printCOFFSymbolTable(const COFFObjectFile *coff) { for (unsigned SI = 0, SE = coff->getNumberOfSymbols(); SI != SE; ++SI) { Expected Symbol = coff->getSymbol(SI); + if (!Symbol) + report_error(Symbol.takeError(), coff->getFileName()); + StringRef Name; - error(Symbol.takeError()); - error(coff->getSymbolName(*Symbol, Name)); + if (std::error_code EC = coff->getSymbolName(*Symbol, Name)) + report_error(errorCodeToError(EC), coff->getFileName()); outs() << "[" << format("%2d", SI) << "]" << "(sec " << format("%2d", int(Symbol->getSectionNumber())) << ")" @@ -674,7 +694,9 @@ for (unsigned AI = 0, AE = Symbol->getNumberOfAuxSymbols(); AI < AE; ++AI, ++SI) { if (Symbol->isSectionDefinition()) { const coff_aux_section_definition *asd; - error(coff->getAuxSymbol(SI + 1, asd)); + if (std::error_code EC = + coff->getAuxSymbol(SI + 1, asd)) + report_error(errorCodeToError(EC), coff->getFileName()); int32_t AuxNumber = asd->getNumber(Symbol->isBigObj()); @@ -689,7 +711,8 @@ , unsigned(asd->Selection)); } else if (Symbol->isFileRecord()) { const char *FileName; - error(coff->getAuxSymbol(SI + 1, FileName)); + if (std::error_code EC = coff->getAuxSymbol(SI + 1, FileName)) + report_error(errorCodeToError(EC), coff->getFileName()); StringRef Name(FileName, Symbol->getNumberOfAuxSymbols() * coff->getSymbolTableEntrySize()); @@ -699,7 +722,9 @@ break; } else if (Symbol->isWeakExternal()) { const coff_aux_weak_external *awe; - error(coff->getAuxSymbol(SI + 1, awe)); + if (std::error_code EC = + coff->getAuxSymbol(SI + 1, awe)) + report_error(errorCodeToError(EC), coff->getFileName()); outs() << "AUX " << format("indx %d srch %d\n", static_cast(awe->TagIndex), Index: tools/llvm-objdump/ELFDump.cpp =================================================================== --- tools/llvm-objdump/ELFDump.cpp +++ tools/llvm-objdump/ELFDump.cpp @@ -178,7 +178,7 @@ outs() << (Data + Dyn.d_un.d_val) << "\n"; continue; } - warn(toString(StrTabOrErr.takeError())); + report_warn(toString(StrTabOrErr.takeError()), Filename); consumeError(StrTabOrErr.takeError()); } outs() << format(Fmt, (uint64_t)Dyn.d_un.d_val); Index: tools/llvm-objdump/MachODump.cpp =================================================================== --- tools/llvm-objdump/MachODump.cpp +++ tools/llvm-objdump/MachODump.cpp @@ -2422,9 +2422,10 @@ report_error(std::move(Err), Filename); } else { consumeError(AOrErr.takeError()); - error("Mach-O universal file: " + Filename + " for " + - "architecture " + StringRef(I->getArchFlagName()) + - " is not a Mach-O file or an archive file"); + report_error(Filename, + "Mach-O universal file for architecture " + + StringRef(I->getArchFlagName()) + + " is not a Mach-O file or an archive file"); } } } @@ -2479,9 +2480,10 @@ report_error(std::move(Err), Filename); } else { consumeError(AOrErr.takeError()); - error("Mach-O universal file: " + Filename + " for architecture " + - StringRef(I->getArchFlagName()) + - " is not a Mach-O file or an archive file"); + report_error(Filename, + "Mach-O universal file for architecture " + + StringRef(I->getArchFlagName()) + + " is not a Mach-O file or an archive file"); } return; } @@ -2532,9 +2534,9 @@ report_error(std::move(Err), Filename); } else { consumeError(AOrErr.takeError()); - error("Mach-O universal file: " + Filename + " for architecture " + - StringRef(I->getArchFlagName()) + - " is not a Mach-O file or an archive file"); + report_error(Filename, "Mach-O universal file for architecture " + + StringRef(I->getArchFlagName()) + + " is not a Mach-O file or an archive file"); } } } Index: tools/llvm-objdump/llvm-objdump.h =================================================================== --- tools/llvm-objdump/llvm-objdump.h +++ tools/llvm-objdump/llvm-objdump.h @@ -96,8 +96,6 @@ uint64_t getELFSectionLMA(const object::ELFSectionRef& Sec); -void error(std::error_code ec); -void error(Error E); bool isRelocAddressLess(object::RelocationRef A, object::RelocationRef B); void parseInputMachO(StringRef Filename); void parseInputMachO(object::MachOUniversalBinary *UB); @@ -129,8 +127,6 @@ void printSectionContents(const object::ObjectFile *O); void printSymbolTable(const object::ObjectFile *O, StringRef ArchiveName, StringRef ArchitectureName = StringRef()); -void warn(Twine Message); -LLVM_ATTRIBUTE_NORETURN void error(Twine Message); LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, Twine Message); LLVM_ATTRIBUTE_NORETURN void report_error(Error E, StringRef File); LLVM_ATTRIBUTE_NORETURN void @@ -139,6 +135,7 @@ LLVM_ATTRIBUTE_NORETURN void report_error(Error E, StringRef ArchiveName, const object::Archive::Child &C, StringRef ArchitectureName = StringRef()); +void report_warn(Twine Message, StringRef File); template T unwrapOrError(Expected EO, Ts &&... Args) { Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -364,39 +364,25 @@ return SectionFilter([](object::SectionRef S) { return shouldKeep(S); }, O); } -void error(std::error_code EC) { - if (!EC) - return; - WithColor::error(errs(), ToolName) - << "reading file: " << EC.message() << ".\n"; - errs().flush(); - exit(1); -} - -void error(Error E) { - if (!E) - return; - WithColor::error(errs(), ToolName) << toString(std::move(E)); - exit(1); -} - -LLVM_ATTRIBUTE_NORETURN void error(Twine Message) { - WithColor::error(errs(), ToolName) << Message << ".\n"; - errs().flush(); - exit(1); -} - -void warn(Twine Message) { +void report_warn(Twine Message, StringRef File) { // Output order between errs() and outs() matters especially for archive // files where the output is per member object. outs().flush(); - WithColor::warning(errs(), ToolName) << Message << "\n"; + + if (File.empty()) + WithColor::warning(errs(), ToolName) << Message << ".\n"; + else + WithColor::warning(errs(), ToolName) + << "'" << File << "': " << Message << ".\n"; errs().flush(); } LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, Twine Message) { - WithColor::error(errs(), ToolName) - << "'" << File << "': " << Message << ".\n"; + if (File.empty()) + WithColor::error(errs(), ToolName) << Message << ".\n"; + else + WithColor::error(errs(), ToolName) + << "'" << File << "': " << Message << ".\n"; exit(1); } @@ -455,37 +441,32 @@ // Warn only if no section in FilterSections is matched. for (StringRef S : MissingSections) - warn("section '" + S + "' mentioned in a -j/--section option, but not " - "found in any input file"); + report_warn("section '" + S + + "' mentioned in a -j/--section option, but not " + "found in any input file", + "" /*FileName*/); } -static const Target *getTarget(const ObjectFile *Obj = nullptr) { +static const Target *getTarget(const ObjectFile *Obj) { // Figure out the target triple. Triple TheTriple("unknown-unknown-unknown"); if (TripleName.empty()) { - if (Obj) - TheTriple = Obj->makeTriple(); + TheTriple = Obj->makeTriple(); } else { TheTriple.setTriple(Triple::normalize(TripleName)); // Use the triple, but also try to combine with ARM build attributes. - if (Obj) { - auto Arch = Obj->getArch(); - if (Arch == Triple::arm || Arch == Triple::armeb) - Obj->setARMSubArch(TheTriple); - } + auto Arch = Obj->getArch(); + if (Arch == Triple::arm || Arch == Triple::armeb) + Obj->setARMSubArch(TheTriple); } // Get the target specific parser. std::string Error; const Target *TheTarget = TargetRegistry::lookupTarget(ArchName, TheTriple, Error); - if (!TheTarget) { - if (Obj) - report_error(Obj->getFileName(), "can't find target: " + Error); - else - error("can't find target: " + Error); - } + if (!TheTarget) + report_error(Obj->getFileName(), "can't find target: " + Error); // Update the triple name and return the found target. TripleName = TheTriple.getTriple(); @@ -585,8 +566,8 @@ auto BufferOrError = MemoryBuffer::getFile(LineInfo.FileName); if (!BufferOrError) { if (MissingSources.insert(LineInfo.FileName).second) - warn("failed to find source " + LineInfo.FileName); - + report_warn("failed to find source " + LineInfo.FileName, + Obj->getFileName()); return false; } Buffer = std::move(*BufferOrError); @@ -624,11 +605,10 @@ if (LineInfo.FileName == DILineInfo::BadString) { if (!WarnedNoDebugInfo) { - std::string Warning = - "failed to parse debug information for " + ObjectFilename.str(); + std::string Warning = "failed to parse debug information"; if (!ErrorMessage.empty()) Warning += ": " + ErrorMessage; - warn(Warning); + report_warn(Warning, ObjectFilename); WarnedNoDebugInfo = true; } return; @@ -647,9 +627,11 @@ auto LineBuffer = LineCache.find(LineInfo.FileName); if (LineBuffer != LineCache.end()) { if (LineInfo.Line > LineBuffer->second.size()) { - warn(formatv( - "debug info line number {0} exceeds the number of lines in {1}", - LineInfo.Line, LineInfo.FileName)); + report_warn( + formatv( + "debug info line number {0} exceeds the number of lines in {1}", + LineInfo.Line, LineInfo.FileName), + ObjectFilename); return; } // Vector begins at 0, line numbers are non-zero @@ -673,13 +655,14 @@ return isArmElf(Obj) || isAArch64Elf(Obj); } -static void printRelocation(const RelocationRef &Rel, uint64_t Address, - bool Is64Bits) { +static void printRelocation(StringRef FileName, const RelocationRef &Rel, + uint64_t Address, bool Is64Bits) { StringRef Fmt = Is64Bits ? "\t\t%016" PRIx64 ": " : "\t\t\t%08" PRIx64 ": "; SmallString<16> Name; SmallString<32> Val; Rel.getTypeName(Name); - error(getRelocationValueString(Rel, Val)); + if (Error E = getRelocationValueString(Rel, Val)) + report_error(std::move(E), FileName); outs() << format(Fmt.data(), Address) << Name << "\t" << Val << "\n"; } @@ -763,7 +746,7 @@ auto PrintReloc = [&]() -> void { while ((RelCur != RelEnd) && (RelCur->getOffset() <= Address.Address)) { if (RelCur->getOffset() == Address.Address) { - printRelocation(*RelCur, Address.Address, false); + printRelocation(ObjectFilename, *RelCur, Address.Address, false); return; } ++RelCur; @@ -1165,11 +1148,14 @@ if (const auto *COFFObj = dyn_cast(Obj)) { for (const auto &ExportEntry : COFFObj->export_directories()) { StringRef Name; - error(ExportEntry.getSymbolName(Name)); + if (std::error_code EC = ExportEntry.getSymbolName(Name)) + report_error(errorCodeToError(EC), Obj->getFileName()); if (Name.empty()) continue; + uint32_t RVA; - error(ExportEntry.getExportRVA(RVA)); + if (std::error_code EC = ExportEntry.getExportRVA(RVA)) + report_error(errorCodeToError(EC), Obj->getFileName()); uint64_t VA = COFFObj->getImageBase() + RVA; auto Sec = partition_point( @@ -1497,7 +1483,8 @@ Offset += AdjustVMA; } - printRelocation(*RelCur, SectionAddr + Offset, Is64Bits); + printRelocation(Obj->getFileName(), *RelCur, SectionAddr + Offset, + Is64Bits); ++RelCur; } } @@ -1509,7 +1496,8 @@ StringSet<> MissingDisasmFuncsSet = set_difference(DisasmFuncsSet, FoundDisasmFuncsSet); for (StringRef MissingDisasmFunc : MissingDisasmFuncsSet.keys()) - warn("failed to disassemble missing function " + MissingDisasmFunc); + report_warn("failed to disassemble missing function " + MissingDisasmFunc, + FileName); } static void disassembleObject(const ObjectFile *Obj, bool InlineRelocs) { @@ -1585,7 +1573,8 @@ for (StringRef Opt : DisassemblerOptions) if (!IP->applyTargetSpecificCLOption(Opt)) - error("Unrecognized disassembler option: " + Opt); + report_error(Obj->getFileName(), + "Unrecognized disassembler option: " + Opt); disassembleObject(TheTarget, Obj, Ctx, DisAsm.get(), SecondaryDisAsm.get(), MIA.get(), IP.get(), STI.get(), SecondarySTI.get(), PIP, @@ -1623,7 +1612,9 @@ if (Address < StartAddress || Address > StopAddress || getHidden(Reloc)) continue; Reloc.getTypeName(RelocName); - error(getRelocationValueString(Reloc, ValueStr)); + if (Error E = getRelocationValueString(Reloc, ValueStr)) + report_error(std::move(E), Obj->getFileName()); + outs() << format(Fmt.data(), Address) << " " << RelocName << " " << ValueStr << "\n"; } @@ -1639,7 +1630,7 @@ const auto *Elf = dyn_cast(Obj); if (!Elf || Elf->getEType() != ELF::ET_DYN) { - error("not a dynamic object"); + report_error(Obj->getFileName(), "not a dynamic object"); return; } @@ -1655,7 +1646,9 @@ SmallString<32> RelocName; SmallString<32> ValueStr; Reloc.getTypeName(RelocName); - error(getRelocationValueString(Reloc, ValueStr)); + if (Error E = getRelocationValueString(Reloc, ValueStr)) + report_error(std::move(E), Obj->getFileName()); + outs() << format(Fmt.data(), Address) << " " << RelocName << " " << ValueStr << "\n"; } @@ -2070,15 +2063,18 @@ } if (StartAddress.getNumOccurrences() == 0) - warn("no section has address less than 0x" + - Twine::utohexstr(Stop) + " specified by --stop-address"); + report_warn("no section has address less than 0x" + Twine::utohexstr(Stop) + + " specified by --stop-address", + Obj->getFileName()); else if (StopAddress.getNumOccurrences() == 0) - warn("no section has address greater than or equal to 0x" + - Twine::utohexstr(Start) + " specified by --start-address"); + report_warn("no section has address greater than or equal to 0x" + + Twine::utohexstr(Start) + " specified by --start-address", + Obj->getFileName()); else - warn("no section overlaps the range [0x" + - Twine::utohexstr(Start) + ",0x" + Twine::utohexstr(Stop) + - ") specified by --start-address/--stop-address"); + report_warn("no section overlaps the range [0x" + Twine::utohexstr(Start) + + ",0x" + Twine::utohexstr(Stop) + + ") specified by --start-address/--stop-address", + Obj->getFileName()); } static void dumpObject(ObjectFile *O, const Archive *A = nullptr, @@ -2221,7 +2217,8 @@ cl::ParseCommandLineOptions(argc, argv, "llvm object file dumper\n"); if (StartAddress >= StopAddress) - error("start address should be less than stop address"); + report_error("" /*FileName*/, + "start address should be less than stop address"); ToolName = argv[0];