1 //===-- llvm-objdump.cpp - Object file dumping utility for llvm -----------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This program is a utility that works like binutils "objdump", that is, it 11 // dumps out a plethora of information about an object file depending on the 12 // flags. 13 // 14 //===----------------------------------------------------------------------===// 15 16 #include "llvm-objdump.h" 17 #include "MCFunction.h" 18 #include "llvm/Object/Archive.h" 19 #include "llvm/Object/COFF.h" 20 #include "llvm/Object/ObjectFile.h" 21 #include "llvm/ADT/OwningPtr.h" 22 #include "llvm/ADT/StringExtras.h" 23 #include "llvm/ADT/Triple.h" 24 #include "llvm/ADT/STLExtras.h" 25 #include "llvm/MC/MCAsmInfo.h" 26 #include "llvm/MC/MCDisassembler.h" 27 #include "llvm/MC/MCInst.h" 28 #include "llvm/MC/MCInstPrinter.h" 29 #include "llvm/MC/MCInstrInfo.h" 30 #include "llvm/MC/MCRegisterInfo.h" 31 #include "llvm/MC/MCSubtargetInfo.h" 32 #include "llvm/Support/Casting.h" 33 #include "llvm/Support/CommandLine.h" 34 #include "llvm/Support/Debug.h" 35 #include "llvm/Support/FileSystem.h" 36 #include "llvm/Support/Format.h" 37 #include "llvm/Support/GraphWriter.h" 38 #include "llvm/Support/Host.h" 39 #include "llvm/Support/ManagedStatic.h" 40 #include "llvm/Support/MemoryBuffer.h" 41 #include "llvm/Support/MemoryObject.h" 42 #include "llvm/Support/PrettyStackTrace.h" 43 #include "llvm/Support/Signals.h" 44 #include "llvm/Support/SourceMgr.h" 45 #include "llvm/Support/TargetRegistry.h" 46 #include "llvm/Support/TargetSelect.h" 47 #include "llvm/Support/raw_ostream.h" 48 #include "llvm/Support/system_error.h" 49 #include <algorithm> 50 #include <cctype> 51 #include <cstring> 52 using namespace llvm; 53 using namespace object; 54 55 static cl::list<std::string> 56 InputFilenames(cl::Positional, cl::desc("<input object files>"),cl::ZeroOrMore); 57 58 static cl::opt<bool> 59 Disassemble("disassemble", 60 cl::desc("Display assembler mnemonics for the machine instructions")); 61 static cl::alias 62 Disassembled("d", cl::desc("Alias for --disassemble"), 63 cl::aliasopt(Disassemble)); 64 65 static cl::opt<bool> 66 Relocations("r", cl::desc("Display the relocation entries in the file")); 67 68 static cl::opt<bool> 69 SectionContents("s", cl::desc("Display the content of each section")); 70 71 static cl::opt<bool> 72 SymbolTable("t", cl::desc("Display the symbol table")); 73 74 static cl::opt<bool> 75 MachO("macho", cl::desc("Use MachO specific object file parser")); 76 static cl::alias 77 MachOm("m", cl::desc("Alias for --macho"), cl::aliasopt(MachO)); 78 79 cl::opt<std::string> 80 llvm::TripleName("triple", cl::desc("Target triple to disassemble for, " 81 "see -version for available targets")); 82 83 cl::opt<std::string> 84 llvm::ArchName("arch", cl::desc("Target arch to disassemble for, " 85 "see -version for available targets")); 86 87 static cl::opt<bool> 88 SectionHeaders("section-headers", cl::desc("Display summaries of the headers " 89 "for each section.")); 90 static cl::alias 91 SectionHeadersShort("headers", cl::desc("Alias for --section-headers"), 92 cl::aliasopt(SectionHeaders)); 93 static cl::alias 94 SectionHeadersShorter("h", cl::desc("Alias for --section-headers"), 95 cl::aliasopt(SectionHeaders)); 96 97 static StringRef ToolName; 98 99 static bool error(error_code ec) { 100 if (!ec) return false; 101 102 outs() << ToolName << ": error reading file: " << ec.message() << ".\n"; 103 outs().flush(); 104 return true; 105 } 106 107 static const Target *getTarget(const ObjectFile *Obj = NULL) { 108 // Figure out the target triple. 109 llvm::Triple TheTriple("unknown-unknown-unknown"); 110 if (TripleName.empty()) { 111 if (Obj) 112 TheTriple.setArch(Triple::ArchType(Obj->getArch())); 113 } else 114 TheTriple.setTriple(Triple::normalize(TripleName)); 115 116 // Get the target specific parser. 117 std::string Error; 118 const Target *TheTarget = TargetRegistry::lookupTarget(ArchName, TheTriple, 119 Error); 120 if (!TheTarget) { 121 errs() << ToolName << ": " << Error; 122 return 0; 123 } 124 125 // Update the triple name and return the found target. 126 TripleName = TheTriple.getTriple(); 127 return TheTarget; 128 } 129 130 void llvm::StringRefMemoryObject::anchor() { } 131 132 void llvm::DumpBytes(StringRef bytes) { 133 static const char hex_rep[] = "0123456789abcdef"; 134 // FIXME: The real way to do this is to figure out the longest instruction 135 // and align to that size before printing. I'll fix this when I get 136 // around to outputting relocations. 137 // 15 is the longest x86 instruction 138 // 3 is for the hex rep of a byte + a space. 139 // 1 is for the null terminator. 140 enum { OutputSize = (15 * 3) + 1 }; 141 char output[OutputSize]; 142 143 assert(bytes.size() <= 15 144 && "DumpBytes only supports instructions of up to 15 bytes"); 145 memset(output, ' ', sizeof(output)); 146 unsigned index = 0; 147 for (StringRef::iterator i = bytes.begin(), 148 e = bytes.end(); i != e; ++i) { 149 output[index] = hex_rep[(*i & 0xF0) >> 4]; 150 output[index + 1] = hex_rep[*i & 0xF]; 151 index += 3; 152 } 153 154 output[sizeof(output) - 1] = 0; 155 outs() << output; 156 } 157 158 static bool RelocAddressLess(RelocationRef a, RelocationRef b) { 159 uint64_t a_addr, b_addr; 160 if (error(a.getAddress(a_addr))) return false; 161 if (error(b.getAddress(b_addr))) return false; 162 return a_addr < b_addr; 163 } 164 165 static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { 166 const Target *TheTarget = getTarget(Obj); 167 // getTarget() will have already issued a diagnostic if necessary, so 168 // just bail here if it failed. 169 if (!TheTarget) 170 return; 171 172 error_code ec; 173 for (section_iterator i = Obj->begin_sections(), 174 e = Obj->end_sections(); 175 i != e; i.increment(ec)) { 176 if (error(ec)) break; 177 bool text; 178 if (error(i->isText(text))) break; 179 if (!text) continue; 180 181 uint64_t SectionAddr; 182 if (error(i->getAddress(SectionAddr))) break; 183 184 // Make a list of all the symbols in this section. 185 std::vector<std::pair<uint64_t, StringRef> > Symbols; 186 for (symbol_iterator si = Obj->begin_symbols(), 187 se = Obj->end_symbols(); 188 si != se; si.increment(ec)) { 189 bool contains; 190 if (!error(i->containsSymbol(*si, contains)) && contains) { 191 uint64_t Address; 192 if (error(si->getAddress(Address))) break; 193 Address -= SectionAddr; 194 195 StringRef Name; 196 if (error(si->getName(Name))) break; 197 Symbols.push_back(std::make_pair(Address, Name)); 198 } 199 } 200 201 // Sort the symbols by address, just in case they didn't come in that way. 202 array_pod_sort(Symbols.begin(), Symbols.end()); 203 204 // Make a list of all the relocations for this section. 205 std::vector<RelocationRef> Rels; 206 if (InlineRelocs) { 207 for (relocation_iterator ri = i->begin_relocations(), 208 re = i->end_relocations(); 209 ri != re; ri.increment(ec)) { 210 if (error(ec)) break; 211 Rels.push_back(*ri); 212 } 213 } 214 215 // Sort relocations by address. 216 std::sort(Rels.begin(), Rels.end(), RelocAddressLess); 217 218 StringRef name; 219 if (error(i->getName(name))) break; 220 outs() << "Disassembly of section " << name << ':'; 221 222 // If the section has no symbols just insert a dummy one and disassemble 223 // the whole section. 224 if (Symbols.empty()) 225 Symbols.push_back(std::make_pair(0, name)); 226 227 // Set up disassembler. 228 OwningPtr<const MCAsmInfo> AsmInfo(TheTarget->createMCAsmInfo(TripleName)); 229 230 if (!AsmInfo) { 231 errs() << "error: no assembly info for target " << TripleName << "\n"; 232 return; 233 } 234 235 OwningPtr<const MCSubtargetInfo> STI( 236 TheTarget->createMCSubtargetInfo(TripleName, "", "")); 237 238 if (!STI) { 239 errs() << "error: no subtarget info for target " << TripleName << "\n"; 240 return; 241 } 242 243 OwningPtr<const MCDisassembler> DisAsm( 244 TheTarget->createMCDisassembler(*STI)); 245 if (!DisAsm) { 246 errs() << "error: no disassembler for target " << TripleName << "\n"; 247 return; 248 } 249 250 OwningPtr<const MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName)); 251 if (!MRI) { 252 errs() << "error: no register info for target " << TripleName << "\n"; 253 return; 254 } 255 256 OwningPtr<const MCInstrInfo> MII(TheTarget->createMCInstrInfo()); 257 if (!MII) { 258 errs() << "error: no instruction info for target " << TripleName << "\n"; 259 return; 260 } 261 262 int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); 263 OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter( 264 AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI)); 265 if (!IP) { 266 errs() << "error: no instruction printer for target " << TripleName 267 << '\n'; 268 return; 269 } 270 271 StringRef Bytes; 272 if (error(i->getContents(Bytes))) break; 273 StringRefMemoryObject memoryObject(Bytes); 274 uint64_t Size; 275 uint64_t Index; 276 uint64_t SectSize; 277 if (error(i->getSize(SectSize))) break; 278 279 std::vector<RelocationRef>::const_iterator rel_cur = Rels.begin(); 280 std::vector<RelocationRef>::const_iterator rel_end = Rels.end(); 281 // Disassemble symbol by symbol. 282 for (unsigned si = 0, se = Symbols.size(); si != se; ++si) { 283 uint64_t Start = Symbols[si].first; 284 uint64_t End; 285 // The end is either the size of the section or the beginning of the next 286 // symbol. 287 if (si == se - 1) 288 End = SectSize; 289 // Make sure this symbol takes up space. 290 else if (Symbols[si + 1].first != Start) 291 End = Symbols[si + 1].first - 1; 292 else 293 // This symbol has the same address as the next symbol. Skip it. 294 continue; 295 296 outs() << '\n' << Symbols[si].second << ":\n"; 297 298 #ifndef NDEBUG 299 raw_ostream &DebugOut = DebugFlag ? dbgs() : nulls(); 300 #else 301 raw_ostream &DebugOut = nulls(); 302 #endif 303 304 for (Index = Start; Index < End; Index += Size) { 305 MCInst Inst; 306 307 if (DisAsm->getInstruction(Inst, Size, memoryObject, Index, 308 DebugOut, nulls())) { 309 outs() << format("%8" PRIx64 ":\t", SectionAddr + Index); 310 DumpBytes(StringRef(Bytes.data() + Index, Size)); 311 IP->printInst(&Inst, outs(), ""); 312 outs() << "\n"; 313 } else { 314 errs() << ToolName << ": warning: invalid instruction encoding\n"; 315 if (Size == 0) 316 Size = 1; // skip illegible bytes 317 } 318 319 // Print relocation for instruction. 320 while (rel_cur != rel_end) { 321 bool hidden = false; 322 uint64_t addr; 323 SmallString<16> name; 324 SmallString<32> val; 325 326 // If this relocation is hidden, skip it. 327 if (error(rel_cur->getHidden(hidden))) goto skip_print_rel; 328 if (hidden) goto skip_print_rel; 329 330 if (error(rel_cur->getAddress(addr))) goto skip_print_rel; 331 // Stop when rel_cur's address is past the current instruction. 332 if (addr >= Index + Size) break; 333 if (error(rel_cur->getTypeName(name))) goto skip_print_rel; 334 if (error(rel_cur->getValueString(val))) goto skip_print_rel; 335 336 outs() << format("\t\t\t%8" PRIx64 ": ", SectionAddr + addr) << name 337 << "\t" << val << "\n"; 338 339 skip_print_rel: 340 ++rel_cur; 341 } 342 } 343 } 344 } 345 } 346 347 static void PrintRelocations(const ObjectFile *o) { 348 error_code ec; 349 for (section_iterator si = o->begin_sections(), se = o->end_sections(); 350 si != se; si.increment(ec)){ 351 if (error(ec)) return; 352 if (si->begin_relocations() == si->end_relocations()) 353 continue; 354 StringRef secname; 355 if (error(si->getName(secname))) continue; 356 outs() << "RELOCATION RECORDS FOR [" << secname << "]:\n"; 357 for (relocation_iterator ri = si->begin_relocations(), 358 re = si->end_relocations(); 359 ri != re; ri.increment(ec)) { 360 if (error(ec)) return; 361 362 bool hidden; 363 uint64_t address; 364 SmallString<32> relocname; 365 SmallString<32> valuestr; 366 if (error(ri->getHidden(hidden))) continue; 367 if (hidden) continue; 368 if (error(ri->getTypeName(relocname))) continue; 369 if (error(ri->getAddress(address))) continue; 370 if (error(ri->getValueString(valuestr))) continue; 371 outs() << address << " " << relocname << " " << valuestr << "\n"; 372 } 373 outs() << "\n"; 374 } 375 } 376 377 static void PrintSectionHeaders(const ObjectFile *o) { 378 outs() << "Sections:\n" 379 "Idx Name Size Address Type\n"; 380 error_code ec; 381 unsigned i = 0; 382 for (section_iterator si = o->begin_sections(), se = o->end_sections(); 383 si != se; si.increment(ec)) { 384 if (error(ec)) return; 385 StringRef Name; 386 if (error(si->getName(Name))) return; 387 uint64_t Address; 388 if (error(si->getAddress(Address))) return; 389 uint64_t Size; 390 if (error(si->getSize(Size))) return; 391 bool Text, Data, BSS; 392 if (error(si->isText(Text))) return; 393 if (error(si->isData(Data))) return; 394 if (error(si->isBSS(BSS))) return; 395 std::string Type = (std::string(Text ? "TEXT " : "") + 396 (Data ? "DATA " : "") + (BSS ? "BSS" : "")); 397 outs() << format("%3d %-13s %09" PRIx64 " %017" PRIx64 " %s\n", 398 i, Name.str().c_str(), Size, Address, Type.c_str()); 399 ++i; 400 } 401 } 402 403 static void PrintSectionContents(const ObjectFile *o) { 404 error_code ec; 405 for (section_iterator si = o->begin_sections(), 406 se = o->end_sections(); 407 si != se; si.increment(ec)) { 408 if (error(ec)) return; 409 StringRef Name; 410 StringRef Contents; 411 uint64_t BaseAddr; 412 if (error(si->getName(Name))) continue; 413 if (error(si->getContents(Contents))) continue; 414 if (error(si->getAddress(BaseAddr))) continue; 415 416 outs() << "Contents of section " << Name << ":\n"; 417 418 // Dump out the content as hex and printable ascii characters. 419 for (std::size_t addr = 0, end = Contents.size(); addr < end; addr += 16) { 420 outs() << format(" %04" PRIx64 " ", BaseAddr + addr); 421 // Dump line of hex. 422 for (std::size_t i = 0; i < 16; ++i) { 423 if (i != 0 && i % 4 == 0) 424 outs() << ' '; 425 if (addr + i < end) 426 outs() << hexdigit((Contents[addr + i] >> 4) & 0xF, true) 427 << hexdigit(Contents[addr + i] & 0xF, true); 428 else 429 outs() << " "; 430 } 431 // Print ascii. 432 outs() << " "; 433 for (std::size_t i = 0; i < 16 && addr + i < end; ++i) { 434 if (std::isprint(Contents[addr + i] & 0xFF)) 435 outs() << Contents[addr + i]; 436 else 437 outs() << "."; 438 } 439 outs() << "\n"; 440 } 441 } 442 } 443 444 static void PrintCOFFSymbolTable(const COFFObjectFile *coff) { 445 const coff_file_header *header; 446 if (error(coff->getHeader(header))) return; 447 int aux_count = 0; 448 const coff_symbol *symbol = 0; 449 for (int i = 0, e = header->NumberOfSymbols; i != e; ++i) { 450 if (aux_count--) { 451 // Figure out which type of aux this is. 452 if (symbol->StorageClass == COFF::IMAGE_SYM_CLASS_STATIC 453 && symbol->Value == 0) { // Section definition. 454 const coff_aux_section_definition *asd; 455 if (error(coff->getAuxSymbol<coff_aux_section_definition>(i, asd))) 456 return; 457 outs() << "AUX " 458 << format("scnlen 0x%x nreloc %d nlnno %d checksum 0x%x " 459 , unsigned(asd->Length) 460 , unsigned(asd->NumberOfRelocations) 461 , unsigned(asd->NumberOfLinenumbers) 462 , unsigned(asd->CheckSum)) 463 << format("assoc %d comdat %d\n" 464 , unsigned(asd->Number) 465 , unsigned(asd->Selection)); 466 } else 467 outs() << "AUX Unknown\n"; 468 } else { 469 StringRef name; 470 if (error(coff->getSymbol(i, symbol))) return; 471 if (error(coff->getSymbolName(symbol, name))) return; 472 outs() << "[" << format("%2d", i) << "]" 473 << "(sec " << format("%2d", int(symbol->SectionNumber)) << ")" 474 << "(fl 0x00)" // Flag bits, which COFF doesn't have. 475 << "(ty " << format("%3x", unsigned(symbol->Type)) << ")" 476 << "(scl " << format("%3x", unsigned(symbol->StorageClass)) << ") " 477 << "(nx " << unsigned(symbol->NumberOfAuxSymbols) << ") " 478 << "0x" << format("%08x", unsigned(symbol->Value)) << " " 479 << name << "\n"; 480 aux_count = symbol->NumberOfAuxSymbols; 481 } 482 } 483 } 484 485 static void PrintSymbolTable(const ObjectFile *o) { 486 outs() << "SYMBOL TABLE:\n"; 487 488 if (const COFFObjectFile *coff = dyn_cast<const COFFObjectFile>(o)) 489 PrintCOFFSymbolTable(coff); 490 else { 491 error_code ec; 492 for (symbol_iterator si = o->begin_symbols(), 493 se = o->end_symbols(); si != se; si.increment(ec)) { 494 if (error(ec)) return; 495 StringRef Name; 496 uint64_t Address; 497 SymbolRef::Type Type; 498 uint64_t Size; 499 uint32_t Flags; 500 section_iterator Section = o->end_sections(); 501 if (error(si->getName(Name))) continue; 502 if (error(si->getAddress(Address))) continue; 503 if (error(si->getFlags(Flags))) continue; 504 if (error(si->getType(Type))) continue; 505 if (error(si->getSize(Size))) continue; 506 if (error(si->getSection(Section))) continue; 507 508 bool Global = Flags & SymbolRef::SF_Global; 509 bool Weak = Flags & SymbolRef::SF_Weak; 510 bool Absolute = Flags & SymbolRef::SF_Absolute; 511 512 if (Address == UnknownAddressOrSize) 513 Address = 0; 514 if (Size == UnknownAddressOrSize) 515 Size = 0; 516 char GlobLoc = ' '; 517 if (Type != SymbolRef::ST_Unknown) 518 GlobLoc = Global ? 'g' : 'l'; 519 char Debug = (Type == SymbolRef::ST_Debug || Type == SymbolRef::ST_File) 520 ? 'd' : ' '; 521 char FileFunc = ' '; 522 if (Type == SymbolRef::ST_File) 523 FileFunc = 'f'; 524 else if (Type == SymbolRef::ST_Function) 525 FileFunc = 'F'; 526 527 outs() << format("%08" PRIx64, Address) << " " 528 << GlobLoc // Local -> 'l', Global -> 'g', Neither -> ' ' 529 << (Weak ? 'w' : ' ') // Weak? 530 << ' ' // Constructor. Not supported yet. 531 << ' ' // Warning. Not supported yet. 532 << ' ' // Indirect reference to another symbol. 533 << Debug // Debugging (d) or dynamic (D) symbol. 534 << FileFunc // Name of function (F), file (f) or object (O). 535 << ' '; 536 if (Absolute) 537 outs() << "*ABS*"; 538 else if (Section == o->end_sections()) 539 outs() << "*UND*"; 540 else { 541 StringRef SectionName; 542 if (error(Section->getName(SectionName))) 543 SectionName = ""; 544 outs() << SectionName; 545 } 546 outs() << '\t' 547 << format("%08" PRIx64 " ", Size) 548 << Name 549 << '\n'; 550 } 551 } 552 } 553 554 static void DumpObject(const ObjectFile *o) { 555 outs() << '\n'; 556 outs() << o->getFileName() 557 << ":\tfile format " << o->getFileFormatName() << "\n\n"; 558 559 if (Disassemble) 560 DisassembleObject(o, Relocations); 561 if (Relocations && !Disassemble) 562 PrintRelocations(o); 563 if (SectionHeaders) 564 PrintSectionHeaders(o); 565 if (SectionContents) 566 PrintSectionContents(o); 567 if (SymbolTable) 568 PrintSymbolTable(o); 569 } 570 571 /// @brief Dump each object file in \a a; 572 static void DumpArchive(const Archive *a) { 573 for (Archive::child_iterator i = a->begin_children(), 574 e = a->end_children(); i != e; ++i) { 575 OwningPtr<Binary> child; 576 if (error_code ec = i->getAsBinary(child)) { 577 // Ignore non-object files. 578 if (ec != object_error::invalid_file_type) 579 errs() << ToolName << ": '" << a->getFileName() << "': " << ec.message() 580 << ".\n"; 581 continue; 582 } 583 if (ObjectFile *o = dyn_cast<ObjectFile>(child.get())) 584 DumpObject(o); 585 else 586 errs() << ToolName << ": '" << a->getFileName() << "': " 587 << "Unrecognized file type.\n"; 588 } 589 } 590 591 /// @brief Open file and figure out how to dump it. 592 static void DumpInput(StringRef file) { 593 // If file isn't stdin, check that it exists. 594 if (file != "-" && !sys::fs::exists(file)) { 595 errs() << ToolName << ": '" << file << "': " << "No such file\n"; 596 return; 597 } 598 599 if (MachO && Disassemble) { 600 DisassembleInputMachO(file); 601 return; 602 } 603 604 // Attempt to open the binary. 605 OwningPtr<Binary> binary; 606 if (error_code ec = createBinary(file, binary)) { 607 errs() << ToolName << ": '" << file << "': " << ec.message() << ".\n"; 608 return; 609 } 610 611 if (Archive *a = dyn_cast<Archive>(binary.get())) 612 DumpArchive(a); 613 else if (ObjectFile *o = dyn_cast<ObjectFile>(binary.get())) 614 DumpObject(o); 615 else 616 errs() << ToolName << ": '" << file << "': " << "Unrecognized file type.\n"; 617 } 618 619 int main(int argc, char **argv) { 620 // Print a stack trace if we signal out. 621 sys::PrintStackTraceOnErrorSignal(); 622 PrettyStackTraceProgram X(argc, argv); 623 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. 624 625 // Initialize targets and assembly printers/parsers. 626 llvm::InitializeAllTargetInfos(); 627 llvm::InitializeAllTargetMCs(); 628 llvm::InitializeAllAsmParsers(); 629 llvm::InitializeAllDisassemblers(); 630 631 // Register the target printer for --version. 632 cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion); 633 634 cl::ParseCommandLineOptions(argc, argv, "llvm object file dumper\n"); 635 TripleName = Triple::normalize(TripleName); 636 637 ToolName = argv[0]; 638 639 // Defaults to a.out if no filenames specified. 640 if (InputFilenames.size() == 0) 641 InputFilenames.push_back("a.out"); 642 643 if (!Disassemble 644 && !Relocations 645 && !SectionHeaders 646 && !SectionContents 647 && !SymbolTable) { 648 cl::PrintHelpMessage(); 649 return 2; 650 } 651 652 std::for_each(InputFilenames.begin(), InputFilenames.end(), 653 DumpInput); 654 655 return 0; 656 } 657