[llvm] r306794 - [llvm-readobj] Include the PE magic value in printouts
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 30 00:02:04 PDT 2017
Author: mstorsjo
Date: Fri Jun 30 00:02:04 2017
New Revision: 306794
URL: http://llvm.org/viewvc/llvm-project?rev=306794&view=rev
Log:
[llvm-readobj] Include the PE magic value in printouts
This is useful for a testcase in lld.
Differential Revision: https://reviews.llvm.org/D34836
Modified:
llvm/trunk/test/tools/llvm-readobj/file-headers.test
llvm/trunk/test/tools/llvm-readobj/peplus.test
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/test/tools/llvm-readobj/file-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/file-headers.test?rev=306794&r1=306793&r2=306794&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/file-headers.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/file-headers.test Fri Jun 30 00:02:04 2017
@@ -238,6 +238,7 @@ PE32-NEXT: IMAGE_FILE_EXECUTABLE_IMA
PE32-NEXT: ]
PE32-NEXT: }
PE32-NEXT: ImageOptionalHeader {
+PE32-NEXT: Magic: 0x10B
PE32-NEXT: MajorLinkerVersion: 11
PE32-NEXT: MinorLinkerVersion: 0
PE32-NEXT: SizeOfCode: 512
Modified: llvm/trunk/test/tools/llvm-readobj/peplus.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/peplus.test?rev=306794&r1=306793&r2=306794&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/peplus.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/peplus.test Fri Jun 30 00:02:04 2017
@@ -16,6 +16,7 @@ CHECK: IMAGE_FILE_LARGE_ADDRESS_AWAR
CHECK: ]
CHECK: }
CHECK: ImageOptionalHeader {
+CHECK: Magic: 0x20B
CHECK: MajorLinkerVersion: 11
CHECK: MinorLinkerVersion: 0
CHECK: SizeOfCode: 512
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=306794&r1=306793&r2=306794&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Fri Jun 30 00:02:04 2017
@@ -678,6 +678,7 @@ void COFFDumper::printDOSHeader(const do
template <class PEHeader>
void COFFDumper::printPEHeader(const PEHeader *Hdr) {
DictScope D(W, "ImageOptionalHeader");
+ W.printHex ("Magic", Hdr->Magic);
W.printNumber("MajorLinkerVersion", Hdr->MajorLinkerVersion);
W.printNumber("MinorLinkerVersion", Hdr->MinorLinkerVersion);
W.printNumber("SizeOfCode", Hdr->SizeOfCode);
More information about the llvm-commits
mailing list