--- /dev/null
+# RUN: yaml2obj %s > %t
+# RUN: llvm-objdump --all-headers %t | FileCheck %s
+
+## Check we print file format, architecture and start address before
+## anything else when using --all-headers.
+
+# CHECK: file format ELF64-x86-64
+# CHECK-EMPTY:
+# CHECK-NEXT: architecture: x86_64
+# CHECK-NEXT: start address: 0x0000000000000000
+# CHECK-EMPTY:
+# CHECK-NEXT: Sections:
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+Sections:
StringRef Fmt = o->getBytesInAddress() > 4 ? "%016" PRIx64 : "%08" PRIx64;
uint64_t Address = StartAddrOrErr.get();
outs() << "start address: "
- << "0x" << format(Fmt.data(), Address)
- << "\n";
+ << "0x" << format(Fmt.data(), Address) << "\n\n";
}
static void printArchiveChild(StringRef Filename, const Archive::Child &C) {
outs() << ":\tfile format " << o->getFileFormatName() << "\n\n";
}
+ if (FileHeaders)
+ printFileHeaders(o);
if (ArchiveHeaders && !MachOOpt && c)
printArchiveChild(ArchiveName, *c);
if (Disassemble)
PrintUnwindInfo(o);
if (PrivateHeaders || FirstPrivateHeader)
printPrivateFileHeaders(o, FirstPrivateHeader);
- if (FileHeaders)
- printFileHeaders(o);
if (ExportsTrie)
printExportsTrie(o);
if (Rebase)
InputFilenames.push_back("a.out");
if (AllHeaders)
- PrivateHeaders = Relocations = SectionHeaders = SymbolTable = true;
+ FileHeaders = PrivateHeaders = Relocations = SectionHeaders = SymbolTable =
+ true;
if (DisassembleAll || PrintSource || PrintLines)
Disassemble = true;