1 //===- llvm-readobj.cpp - Dump contents of an Object File -----------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This is a tool similar to readelf, except it works on multiple object file
11 // formats. The main purpose of this tool is to provide detailed output suitable
14 // Flags should be similar to readelf where supported, but the output format
15 // does not need to be identical. The point is to not make users learn yet
16 // another set of flags.
18 // Output should be specialized for each format where appropriate.
20 //===----------------------------------------------------------------------===//
22 #include "llvm-readobj.h"
24 #include "ObjDumper.h"
25 #include "WindowsResourceDumper.h"
26 #include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h"
27 #include "llvm/Object/Archive.h"
28 #include "llvm/Object/COFFImportFile.h"
29 #include "llvm/Object/MachOUniversal.h"
30 #include "llvm/Object/ObjectFile.h"
31 #include "llvm/Object/WindowsResource.h"
32 #include "llvm/Support/Casting.h"
33 #include "llvm/Support/CommandLine.h"
34 #include "llvm/Support/DataTypes.h"
35 #include "llvm/Support/Debug.h"
36 #include "llvm/Support/FileSystem.h"
37 #include "llvm/Support/FormatVariadic.h"
38 #include "llvm/Support/InitLLVM.h"
39 #include "llvm/Support/Path.h"
40 #include "llvm/Support/ScopedPrinter.h"
41 #include "llvm/Support/TargetRegistry.h"
44 using namespace llvm::object
;
47 cl::list
<std::string
> InputFilenames(cl::Positional
,
48 cl::desc("<input object files>"),
54 cl::desc("Equivalent to setting: --file-headers, --program-headers, "
55 "--section-headers, --symbols, --relocations, "
56 "--dynamic-table, --notes, --version-info, --unwind, "
57 "--section-groups and --elf-hash-histogram."));
58 cl::alias
AllShort("a", cl::desc("Alias for --all"), cl::aliasopt(All
));
63 cl::desc("Equivalent to setting: --file-headers, --program-headers, "
64 "--section-headers"));
65 cl::alias
HeadersShort("e", cl::desc("Alias for --headers"),
66 cl::aliasopt(Headers
));
70 WideOutput("wide", cl::desc("Ignored for compatibility with GNU readelf"),
72 cl::alias
WideOutputShort("W",
73 cl::desc("Alias for --wide"),
74 cl::aliasopt(WideOutput
));
76 // -file-headers, -file-header, -h
77 cl::opt
<bool> FileHeaders("file-headers",
78 cl::desc("Display file headers "));
79 cl::alias
FileHeadersShort("h", cl::desc("Alias for --file-headers"),
80 cl::aliasopt(FileHeaders
), cl::NotHidden
);
81 cl::alias
FileHeadersSingular("file-header",
82 cl::desc("Alias for --file-headers"),
83 cl::aliasopt(FileHeaders
));
85 // -section-headers, -sections, -S
86 // Also -s in llvm-readobj mode.
87 cl::opt
<bool> SectionHeaders("section-headers",
88 cl::desc("Display all section headers."));
89 cl::alias
SectionsShortUpper("S", cl::desc("Alias for --section-headers"),
90 cl::aliasopt(SectionHeaders
), cl::NotHidden
);
91 cl::alias
SectionHeadersAlias("sections",
92 cl::desc("Alias for --section-headers"),
93 cl::aliasopt(SectionHeaders
), cl::NotHidden
);
95 // -section-relocations, -sr
96 cl::opt
<bool> SectionRelocations("section-relocations",
97 cl::desc("Display relocations for each section shown."));
98 cl::alias
SectionRelocationsShort("sr",
99 cl::desc("Alias for --section-relocations"),
100 cl::aliasopt(SectionRelocations
));
102 // -section-symbols, -st
103 cl::opt
<bool> SectionSymbols("section-symbols",
104 cl::desc("Display symbols for each section shown."));
105 cl::alias
SectionSymbolsShort("st",
106 cl::desc("Alias for --section-symbols"),
107 cl::aliasopt(SectionSymbols
));
109 // -section-data, -sd
110 cl::opt
<bool> SectionData("section-data",
111 cl::desc("Display section data for each section shown."));
112 cl::alias
SectionDataShort("sd",
113 cl::desc("Alias for --section-data"),
114 cl::aliasopt(SectionData
));
116 // -relocations, -relocs, -r
117 cl::opt
<bool> Relocations("relocations",
118 cl::desc("Display the relocation entries in the file"));
119 cl::alias
RelocationsShort("r", cl::desc("Alias for --relocations"),
120 cl::aliasopt(Relocations
), cl::NotHidden
);
121 cl::alias
RelocationsGNU("relocs", cl::desc("Alias for --relocations"),
122 cl::aliasopt(Relocations
));
125 cl::opt
<bool> Notes("notes", cl::desc("Display the ELF notes in the file"));
126 cl::alias
NotesShort("n", cl::desc("Alias for --notes"), cl::aliasopt(Notes
));
129 cl::opt
<bool> DynRelocs("dyn-relocations",
130 cl::desc("Display the dynamic relocation entries in the file"));
133 // Also -s in llvm-readelf mode, or -t in llvm-readobj mode.
134 cl::opt
<bool> Symbols("symbols",
135 cl::desc("Display the symbol table"));
136 cl::alias
SymbolsGNU("syms", cl::desc("Alias for --symbols"),
137 cl::aliasopt(Symbols
));
139 // -dyn-symbols, -dyn-syms, -dt
140 cl::opt
<bool> DynamicSymbols("dyn-symbols",
141 cl::desc("Display the dynamic symbol table"));
142 cl::alias
DynamicSymbolsShort("dt",
143 cl::desc("Alias for --dyn-symbols"),
144 cl::aliasopt(DynamicSymbols
));
145 cl::alias
DynSymsGNU("dyn-syms", cl::desc("Alias for --dyn-symbols"),
146 cl::aliasopt(DynamicSymbols
));
149 cl::opt
<bool> UnwindInfo("unwind",
150 cl::desc("Display unwind information"));
151 cl::alias
UnwindInfoShort("u",
152 cl::desc("Alias for --unwind"),
153 cl::aliasopt(UnwindInfo
));
155 // -dynamic-table, -dynamic, -d
156 cl::opt
<bool> DynamicTable("dynamic-table",
157 cl::desc("Display the ELF .dynamic section table"));
158 cl::alias
DynamicTableShort("d", cl::desc("Alias for --dynamic-table"),
159 cl::aliasopt(DynamicTable
), cl::NotHidden
);
160 cl::alias
DynamicTableAlias("dynamic", cl::desc("Alias for --dynamic-table"),
161 cl::aliasopt(DynamicTable
));
164 cl::opt
<bool> NeededLibraries("needed-libs",
165 cl::desc("Display the needed libraries"));
167 // -program-headers, -segments, -l
168 cl::opt
<bool> ProgramHeaders("program-headers",
169 cl::desc("Display ELF program headers"));
170 cl::alias
ProgramHeadersShort("l", cl::desc("Alias for --program-headers"),
171 cl::aliasopt(ProgramHeaders
), cl::NotHidden
);
172 cl::alias
SegmentsAlias("segments", cl::desc("Alias for --program-headers"),
173 cl::aliasopt(ProgramHeaders
));
176 cl::list
<std::string
> StringDump("string-dump", cl::desc("<number|name>"),
178 cl::alias
StringDumpShort("p", cl::desc("Alias for --string-dump"),
179 cl::aliasopt(StringDump
));
182 cl::list
<std::string
> HexDump("hex-dump", cl::desc("<number|name>"),
184 cl::alias
HexDumpShort("x", cl::desc("Alias for --hex-dump"),
185 cl::aliasopt(HexDump
));
188 cl::opt
<bool> HashTable("hash-table",
189 cl::desc("Display ELF hash table"));
192 cl::opt
<bool> GnuHashTable("gnu-hash-table",
193 cl::desc("Display ELF .gnu.hash section"));
196 cl::opt
<bool> ExpandRelocs("expand-relocs",
197 cl::desc("Expand each shown relocation to multiple lines"));
200 cl::opt
<bool> RawRelr("raw-relr",
201 cl::desc("Do not decode relocations in SHT_RELR section, display raw contents"));
204 cl::opt
<bool> CodeView("codeview",
205 cl::desc("Display CodeView debug information"));
207 // -codeview-merged-types
209 CodeViewMergedTypes("codeview-merged-types",
210 cl::desc("Display the merged CodeView type stream"));
212 // -codeview-subsection-bytes
213 cl::opt
<bool> CodeViewSubsectionBytes(
214 "codeview-subsection-bytes",
215 cl::desc("Dump raw contents of codeview debug sections and records"));
218 cl::opt
<bool> ARMAttributes("arm-attributes",
219 cl::desc("Display the ARM attributes section"));
223 MipsPLTGOT("mips-plt-got",
224 cl::desc("Display the MIPS GOT and PLT GOT sections"));
227 cl::opt
<bool> MipsABIFlags("mips-abi-flags",
228 cl::desc("Display the MIPS.abiflags section"));
231 cl::opt
<bool> MipsReginfo("mips-reginfo",
232 cl::desc("Display the MIPS .reginfo section"));
235 cl::opt
<bool> MipsOptions("mips-options",
236 cl::desc("Display the MIPS .MIPS.options section"));
240 COFFImports("coff-imports", cl::desc("Display the PE/COFF import table"));
244 COFFExports("coff-exports", cl::desc("Display the PE/COFF export table"));
248 COFFDirectives("coff-directives",
249 cl::desc("Display the PE/COFF .drectve section"));
253 COFFBaseRelocs("coff-basereloc",
254 cl::desc("Display the PE/COFF .reloc section"));
256 // -coff-debug-directory
258 COFFDebugDirectory("coff-debug-directory",
259 cl::desc("Display the PE/COFF debug directory"));
262 cl::opt
<bool> COFFResources("coff-resources",
263 cl::desc("Display the PE/COFF .rsrc section"));
267 COFFLoadConfig("coff-load-config",
268 cl::desc("Display the PE/COFF load config"));
270 // -elf-linker-options
272 ELFLinkerOptions("elf-linker-options",
273 cl::desc("Display the ELF .linker-options section"));
275 // -macho-data-in-code
277 MachODataInCode("macho-data-in-code",
278 cl::desc("Display MachO Data in Code command"));
280 // -macho-indirect-symbols
282 MachOIndirectSymbols("macho-indirect-symbols",
283 cl::desc("Display MachO indirect symbols"));
285 // -macho-linker-options
287 MachOLinkerOptions("macho-linker-options",
288 cl::desc("Display MachO linker options"));
292 MachOSegment("macho-segment",
293 cl::desc("Display MachO Segment command"));
295 // -macho-version-min
297 MachOVersionMin("macho-version-min",
298 cl::desc("Display MachO version min command"));
302 MachODysymtab("macho-dysymtab",
303 cl::desc("Display MachO Dysymtab command"));
307 PrintStackMap("stackmap",
308 cl::desc("Display contents of stackmap section"));
312 VersionInfo("version-info",
313 cl::desc("Display ELF version sections (if present)"));
314 cl::alias
VersionInfoShort("V", cl::desc("Alias for -version-info"),
315 cl::aliasopt(VersionInfo
));
317 // -elf-section-groups, -section-groups, -g
318 cl::opt
<bool> SectionGroups("elf-section-groups",
319 cl::desc("Display ELF section group contents"));
320 cl::alias
SectionGroupsAlias("section-groups",
321 cl::desc("Alias for -elf-sections-groups"),
322 cl::aliasopt(SectionGroups
));
323 cl::alias
SectionGroupsShort("g", cl::desc("Alias for -elf-sections-groups"),
324 cl::aliasopt(SectionGroups
));
326 // -elf-hash-histogram, -histogram, -I
327 cl::opt
<bool> HashHistogram(
328 "elf-hash-histogram",
329 cl::desc("Display bucket list histogram for hash sections"));
330 cl::alias
HashHistogramShort("I", cl::desc("Alias for -elf-hash-histogram"),
331 cl::aliasopt(HashHistogram
));
332 cl::alias
HistogramAlias("histogram",
333 cl::desc("Alias for --elf-hash-histogram"),
334 cl::aliasopt(HashHistogram
));
337 cl::opt
<bool> CGProfile("elf-cg-profile", cl::desc("Display callgraph profile section"));
340 cl::opt
<bool> Addrsig("addrsig",
341 cl::desc("Display address-significance table"));
344 cl::opt
<OutputStyleTy
>
345 Output("elf-output-style", cl::desc("Specify ELF dump style"),
346 cl::values(clEnumVal(LLVM
, "LLVM default style"),
347 clEnumVal(GNU
, "GNU readelf style")),
353 LLVM_ATTRIBUTE_NORETURN
void reportError(Twine Msg
) {
354 errs() << "\nError reading file: " << Msg
<< ".\n";
359 void error(Error EC
) {
362 handleAllErrors(std::move(EC
),
363 [&](const ErrorInfoBase
&EI
) { reportError(EI
.message()); });
366 void error(std::error_code EC
) {
369 reportError(EC
.message());
372 bool relocAddressLess(RelocationRef a
, RelocationRef b
) {
373 return a
.getOffset() < b
.getOffset();
378 static void reportError(StringRef Input
, std::error_code EC
) {
382 reportError(Twine(Input
) + ": " + EC
.message());
385 static void reportError(StringRef Input
, Error Err
) {
390 raw_string_ostream
ErrStream(ErrMsg
);
391 logAllUnhandledErrors(std::move(Err
), ErrStream
, Input
+ ": ");
396 static bool isMipsArch(unsigned Arch
) {
398 case llvm::Triple::mips
:
399 case llvm::Triple::mipsel
:
400 case llvm::Triple::mips64
:
401 case llvm::Triple::mips64el
:
408 struct ReadObjTypeTableBuilder
{
409 ReadObjTypeTableBuilder()
410 : Allocator(), IDTable(Allocator
), TypeTable(Allocator
) {}
412 llvm::BumpPtrAllocator Allocator
;
413 llvm::codeview::MergingTypeTableBuilder IDTable
;
414 llvm::codeview::MergingTypeTableBuilder TypeTable
;
417 static ReadObjTypeTableBuilder CVTypes
;
419 /// Creates an format-specific object file dumper.
420 static std::error_code
createDumper(const ObjectFile
*Obj
,
421 ScopedPrinter
&Writer
,
422 std::unique_ptr
<ObjDumper
> &Result
) {
424 return readobj_error::unsupported_file_format
;
427 return createCOFFDumper(Obj
, Writer
, Result
);
429 return createELFDumper(Obj
, Writer
, Result
);
431 return createMachODumper(Obj
, Writer
, Result
);
433 return createWasmDumper(Obj
, Writer
, Result
);
435 return readobj_error::unsupported_obj_file_format
;
438 /// Dumps the specified object file.
439 static void dumpObject(const ObjectFile
*Obj
, ScopedPrinter
&Writer
) {
440 std::unique_ptr
<ObjDumper
> Dumper
;
441 if (std::error_code EC
= createDumper(Obj
, Writer
, Dumper
))
442 reportError(Obj
->getFileName(), EC
);
444 if (opts::Output
== opts::LLVM
) {
445 Writer
.startLine() << "\n";
446 Writer
.printString("File", Obj
->getFileName());
447 Writer
.printString("Format", Obj
->getFileFormatName());
448 Writer
.printString("Arch", Triple::getArchTypeName(
449 (llvm::Triple::ArchType
)Obj
->getArch()));
450 Writer
.printString("AddressSize",
451 formatv("{0}bit", 8 * Obj
->getBytesInAddress()));
452 Dumper
->printLoadName();
455 if (opts::FileHeaders
)
456 Dumper
->printFileHeaders();
457 if (opts::SectionHeaders
)
458 Dumper
->printSectionHeaders();
459 if (opts::Relocations
)
460 Dumper
->printRelocations();
462 Dumper
->printDynamicRelocations();
464 Dumper
->printSymbols();
465 if (opts::DynamicSymbols
)
466 Dumper
->printDynamicSymbols();
467 if (opts::UnwindInfo
)
468 Dumper
->printUnwindInfo();
469 if (opts::DynamicTable
)
470 Dumper
->printDynamicTable();
471 if (opts::NeededLibraries
)
472 Dumper
->printNeededLibraries();
473 if (opts::ProgramHeaders
)
474 Dumper
->printProgramHeaders();
475 if (!opts::StringDump
.empty())
476 llvm::for_each(opts::StringDump
, [&Dumper
, Obj
](StringRef SectionName
) {
477 Dumper
->printSectionAsString(Obj
, SectionName
);
479 if (!opts::HexDump
.empty())
480 llvm::for_each(opts::HexDump
, [&Dumper
, Obj
](StringRef SectionName
) {
481 Dumper
->printSectionAsHex(Obj
, SectionName
);
484 Dumper
->printHashTable();
485 if (opts::GnuHashTable
)
486 Dumper
->printGnuHashTable();
487 if (opts::VersionInfo
)
488 Dumper
->printVersionInfo();
490 if (opts::ELFLinkerOptions
)
491 Dumper
->printELFLinkerOptions();
492 if (Obj
->getArch() == llvm::Triple::arm
)
493 if (opts::ARMAttributes
)
494 Dumper
->printAttributes();
495 if (isMipsArch(Obj
->getArch())) {
496 if (opts::MipsPLTGOT
)
497 Dumper
->printMipsPLTGOT();
498 if (opts::MipsABIFlags
)
499 Dumper
->printMipsABIFlags();
500 if (opts::MipsReginfo
)
501 Dumper
->printMipsReginfo();
502 if (opts::MipsOptions
)
503 Dumper
->printMipsOptions();
505 if (opts::SectionGroups
)
506 Dumper
->printGroupSections();
507 if (opts::HashHistogram
)
508 Dumper
->printHashHistogram();
510 Dumper
->printCGProfile();
512 Dumper
->printAddrsig();
514 Dumper
->printNotes();
517 if (opts::COFFImports
)
518 Dumper
->printCOFFImports();
519 if (opts::COFFExports
)
520 Dumper
->printCOFFExports();
521 if (opts::COFFDirectives
)
522 Dumper
->printCOFFDirectives();
523 if (opts::COFFBaseRelocs
)
524 Dumper
->printCOFFBaseReloc();
525 if (opts::COFFDebugDirectory
)
526 Dumper
->printCOFFDebugDirectory();
527 if (opts::COFFResources
)
528 Dumper
->printCOFFResources();
529 if (opts::COFFLoadConfig
)
530 Dumper
->printCOFFLoadConfig();
532 Dumper
->printAddrsig();
534 Dumper
->printCodeViewDebugInfo();
535 if (opts::CodeViewMergedTypes
)
536 Dumper
->mergeCodeViewTypes(CVTypes
.IDTable
, CVTypes
.TypeTable
);
538 if (Obj
->isMachO()) {
539 if (opts::MachODataInCode
)
540 Dumper
->printMachODataInCode();
541 if (opts::MachOIndirectSymbols
)
542 Dumper
->printMachOIndirectSymbols();
543 if (opts::MachOLinkerOptions
)
544 Dumper
->printMachOLinkerOptions();
545 if (opts::MachOSegment
)
546 Dumper
->printMachOSegment();
547 if (opts::MachOVersionMin
)
548 Dumper
->printMachOVersionMin();
549 if (opts::MachODysymtab
)
550 Dumper
->printMachODysymtab();
552 if (opts::PrintStackMap
)
553 Dumper
->printStackMap();
556 /// Dumps each object file in \a Arc;
557 static void dumpArchive(const Archive
*Arc
, ScopedPrinter
&Writer
) {
558 Error Err
= Error::success();
559 for (auto &Child
: Arc
->children(Err
)) {
560 Expected
<std::unique_ptr
<Binary
>> ChildOrErr
= Child
.getAsBinary();
562 if (auto E
= isNotObjectErrorInvalidFileType(ChildOrErr
.takeError())) {
563 reportError(Arc
->getFileName(), ChildOrErr
.takeError());
567 if (ObjectFile
*Obj
= dyn_cast
<ObjectFile
>(&*ChildOrErr
.get()))
568 dumpObject(Obj
, Writer
);
569 else if (COFFImportFile
*Imp
= dyn_cast
<COFFImportFile
>(&*ChildOrErr
.get()))
570 dumpCOFFImportFile(Imp
, Writer
);
572 reportError(Arc
->getFileName(), readobj_error::unrecognized_file_format
);
575 reportError(Arc
->getFileName(), std::move(Err
));
578 /// Dumps each object file in \a MachO Universal Binary;
579 static void dumpMachOUniversalBinary(const MachOUniversalBinary
*UBinary
,
580 ScopedPrinter
&Writer
) {
581 for (const MachOUniversalBinary::ObjectForArch
&Obj
: UBinary
->objects()) {
582 Expected
<std::unique_ptr
<MachOObjectFile
>> ObjOrErr
= Obj
.getAsObjectFile();
584 dumpObject(&*ObjOrErr
.get(), Writer
);
585 else if (auto E
= isNotObjectErrorInvalidFileType(ObjOrErr
.takeError())) {
586 reportError(UBinary
->getFileName(), ObjOrErr
.takeError());
588 else if (Expected
<std::unique_ptr
<Archive
>> AOrErr
= Obj
.getAsArchive())
589 dumpArchive(&*AOrErr
.get(), Writer
);
593 /// Dumps \a WinRes, Windows Resource (.res) file;
594 static void dumpWindowsResourceFile(WindowsResource
*WinRes
) {
595 ScopedPrinter Printer
{outs()};
596 WindowsRes::Dumper
Dumper(WinRes
, Printer
);
597 if (auto Err
= Dumper
.printData())
598 reportError(WinRes
->getFileName(), std::move(Err
));
602 /// Opens \a File and dumps it.
603 static void dumpInput(StringRef File
) {
604 ScopedPrinter
Writer(outs());
606 // Attempt to open the binary.
607 Expected
<OwningBinary
<Binary
>> BinaryOrErr
= createBinary(File
);
609 reportError(File
, BinaryOrErr
.takeError());
610 Binary
&Binary
= *BinaryOrErr
.get().getBinary();
612 if (Archive
*Arc
= dyn_cast
<Archive
>(&Binary
))
613 dumpArchive(Arc
, Writer
);
614 else if (MachOUniversalBinary
*UBinary
=
615 dyn_cast
<MachOUniversalBinary
>(&Binary
))
616 dumpMachOUniversalBinary(UBinary
, Writer
);
617 else if (ObjectFile
*Obj
= dyn_cast
<ObjectFile
>(&Binary
))
618 dumpObject(Obj
, Writer
);
619 else if (COFFImportFile
*Import
= dyn_cast
<COFFImportFile
>(&Binary
))
620 dumpCOFFImportFile(Import
, Writer
);
621 else if (WindowsResource
*WinRes
= dyn_cast
<WindowsResource
>(&Binary
))
622 dumpWindowsResourceFile(WinRes
);
624 reportError(File
, readobj_error::unrecognized_file_format
);
627 /// Registers aliases that should only be allowed by readobj.
628 static void registerReadobjAliases() {
629 // -s has meant --sections for a very long time in llvm-readobj despite
630 // meaning --symbols in readelf.
631 static cl::alias
SectionsShort("s", cl::desc("Alias for --section-headers"),
632 cl::aliasopt(opts::SectionHeaders
),
635 // Only register -t in llvm-readobj, as readelf reserves it for
636 // --section-details (not implemented yet).
637 static cl::alias
SymbolsShort("t", cl::desc("Alias for --symbols"),
638 cl::aliasopt(opts::Symbols
), cl::NotHidden
);
641 /// Registers aliases that should only be allowed by readelf.
642 static void registerReadelfAliases() {
643 // -s is here because for readobj it means --sections.
644 static cl::alias
SymbolsShort("s", cl::desc("Alias for --symbols"),
645 cl::aliasopt(opts::Symbols
), cl::NotHidden
);
648 int main(int argc
, const char *argv
[]) {
649 InitLLVM
X(argc
, argv
);
651 // Register the target printer for --version.
652 cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion
);
654 if (sys::path::stem(argv
[0]).contains("readelf")) {
655 opts::Output
= opts::GNU
;
656 registerReadelfAliases();
658 registerReadobjAliases();
661 cl::ParseCommandLineOptions(argc
, argv
, "LLVM Object Reader\n");
664 opts::FileHeaders
= true;
665 opts::ProgramHeaders
= true;
666 opts::SectionHeaders
= true;
667 opts::Symbols
= true;
668 opts::Relocations
= true;
669 opts::DynamicTable
= true;
671 opts::VersionInfo
= true;
672 opts::UnwindInfo
= true;
673 opts::SectionGroups
= true;
674 opts::HashHistogram
= true;
678 opts::FileHeaders
= true;
679 opts::ProgramHeaders
= true;
680 opts::SectionHeaders
= true;
683 // Default to stdin if no filename is specified.
684 if (opts::InputFilenames
.empty())
685 opts::InputFilenames
.push_back("-");
687 llvm::for_each(opts::InputFilenames
, dumpInput
);
689 if (opts::CodeViewMergedTypes
) {
690 ScopedPrinter
W(outs());
691 dumpCodeViewMergedTypes(W
, CVTypes
.IDTable
, CVTypes
.TypeTable
);