1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[llvm-readobj] Include the PE magic value in printouts

This is useful for a testcase in lld.

Differential Revision: https://reviews.llvm.org/D34836

llvm-svn: 306794
This commit is contained in:
Martin Storsjo 2017-06-30 07:02:04 +00:00
parent c365a19c82
commit 889d6bce69
3 changed files with 3 additions and 0 deletions

View File

@ -238,6 +238,7 @@ PE32-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
PE32-NEXT: ]
PE32-NEXT: }
PE32-NEXT: ImageOptionalHeader {
PE32-NEXT: Magic: 0x10B
PE32-NEXT: MajorLinkerVersion: 11
PE32-NEXT: MinorLinkerVersion: 0
PE32-NEXT: SizeOfCode: 512

View File

@ -16,6 +16,7 @@ CHECK: IMAGE_FILE_LARGE_ADDRESS_AWARE (0x20)
CHECK: ]
CHECK: }
CHECK: ImageOptionalHeader {
CHECK: Magic: 0x20B
CHECK: MajorLinkerVersion: 11
CHECK: MinorLinkerVersion: 0
CHECK: SizeOfCode: 512

View File

@ -678,6 +678,7 @@ void COFFDumper::printDOSHeader(const dos_header *DH) {
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);