llvm.org GIT mirror llvm / 04fde6b
[llvm-objdump] - Change the output for --all-headers. This is for https://bugs.llvm.org/show_bug.cgi?id=40008, it starts printing the file headers when --all-headers is given and do a minor cosmetic change. Differential revision: https://reviews.llvm.org/D56588 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351006 91177308-0d34-0410-b5e6-96231b3b80d8 George Rimar 7 months ago
2 changed file(s) with 25 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
0 # RUN: yaml2obj %s > %t
1 # RUN: llvm-objdump --all-headers %t | FileCheck %s
2
3 ## Check we print file format, architecture and start address before
4 ## anything else when using --all-headers.
5
6 # CHECK: file format ELF64-x86-64
7 # CHECK-EMPTY:
8 # CHECK-NEXT: architecture: x86_64
9 # CHECK-NEXT: start address: 0x0000000000000000
10 # CHECK-EMPTY:
11 # CHECK-NEXT: Sections:
12
13 !ELF
14 FileHeader:
15 Class: ELFCLASS64
16 Data: ELFDATA2LSB
17 Type: ET_EXEC
18 Machine: EM_X86_64
19 Sections:
23002300 StringRef Fmt = o->getBytesInAddress() > 4 ? "%016" PRIx64 : "%08" PRIx64;
23012301 uint64_t Address = StartAddrOrErr.get();
23022302 outs() << "start address: "
2303 << "0x" << format(Fmt.data(), Address)
2304 << "\n";
2303 << "0x" << format(Fmt.data(), Address) << "\n\n";
23052304 }
23062305
23072306 static void printArchiveChild(StringRef Filename, const Archive::Child &C) {
23812380 outs() << ":\tfile format " << o->getFileFormatName() << "\n\n";
23822381 }
23832382
2383 if (FileHeaders)
2384 printFileHeaders(o);
23842385 if (ArchiveHeaders && !MachOOpt && c)
23852386 printArchiveChild(ArchiveName, *c);
23862387 if (Disassemble)
23992400 PrintUnwindInfo(o);
24002401 if (PrivateHeaders || FirstPrivateHeader)
24012402 printPrivateFileHeaders(o, FirstPrivateHeader);
2402 if (FileHeaders)
2403 printFileHeaders(o);
24042403 if (ExportsTrie)
24052404 printExportsTrie(o);
24062405 if (Rebase)
25092508 InputFilenames.push_back("a.out");
25102509
25112510 if (AllHeaders)
2512 PrivateHeaders = Relocations = SectionHeaders = SymbolTable = true;
2511 FileHeaders = PrivateHeaders = Relocations = SectionHeaders = SymbolTable =
2512 true;
25132513
25142514 if (DisassembleAll || PrintSource || PrintLines)
25152515 Disassemble = true;