[PATCH] D56588: [llvm-objdump] - Change the output for --all-headers.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 12 04:21:55 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL351006: [llvm-objdump] - Change the output for --all-headers. (authored by grimar, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56588?vs=181242&id=181439#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56588/new/
https://reviews.llvm.org/D56588
Files:
llvm/trunk/test/tools/llvm-objdump/all-headers.test
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Index: llvm/trunk/test/tools/llvm-objdump/all-headers.test
===================================================================
--- llvm/trunk/test/tools/llvm-objdump/all-headers.test
+++ llvm/trunk/test/tools/llvm-objdump/all-headers.test
@@ -0,0 +1,20 @@
+# 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:
Index: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
@@ -2301,8 +2301,7 @@
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) {
@@ -2382,6 +2381,8 @@
outs() << ":\tfile format " << o->getFileFormatName() << "\n\n";
}
+ if (FileHeaders)
+ printFileHeaders(o);
if (ArchiveHeaders && !MachOOpt && c)
printArchiveChild(ArchiveName, *c);
if (Disassemble)
@@ -2400,8 +2401,6 @@
PrintUnwindInfo(o);
if (PrivateHeaders || FirstPrivateHeader)
printPrivateFileHeaders(o, FirstPrivateHeader);
- if (FileHeaders)
- printFileHeaders(o);
if (ExportsTrie)
printExportsTrie(o);
if (Rebase)
@@ -2510,7 +2509,8 @@
InputFilenames.push_back("a.out");
if (AllHeaders)
- PrivateHeaders = Relocations = SectionHeaders = SymbolTable = true;
+ FileHeaders = PrivateHeaders = Relocations = SectionHeaders = SymbolTable =
+ true;
if (DisassembleAll || PrintSource || PrintLines)
Disassemble = true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56588.181439.patch
Type: text/x-patch
Size: 2231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190112/ae4d5aa3/attachment.bin>
More information about the llvm-commits
mailing list