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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 14:19:54 PDT 2017


mstorsjo added inline comments.


================
Comment at: tools/llvm-readobj/COFFDumper.cpp:681
   DictScope D(W, "ImageOptionalHeader");
+  W.printNumber("Magic", Hdr->Magic);
   W.printNumber("MajorLinkerVersion", Hdr->MajorLinkerVersion);
----------------
ruiu wrote:
> I believe this is 0x8086 for x86, so you want to print it out in hex.
No, it's not that (that's the COFF machine magic word); this is the PE type indicator, 0x10b for normal PE32 and 0x20b for PE32+ (for 64 bit object files). But you're right that it might make more sense to print it in hex.


https://reviews.llvm.org/D34836





More information about the llvm-commits mailing list