[lld] r200019 - [PECOFF] Use constant instead of magic number.

Rui Ueyama ruiu at google.com
Fri Jan 24 10:03:15 PST 2014


Author: ruiu
Date: Fri Jan 24 12:03:14 2014
New Revision: 200019

URL: http://llvm.org/viewvc/llvm-project?rev=200019&view=rev
Log:
[PECOFF] Use constant instead of magic number.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp

Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=200019&r1=200018&r2=200019&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Fri Jan 24 12:03:14 2014
@@ -337,8 +337,8 @@ PEHeaderChunk::PEHeaderChunk(const PECOF
 
   _coffHeader.Characteristics = characteristics;
 
-  // 0x10b indicates a normal PE32 executable. For PE32+ it should be 0x20b.
-  _peHeader.Magic = 0x10b;
+  // A 32-bit executable has PE32 magic (0x10b).
+  _peHeader.Magic = llvm::COFF::PEHeader::PE32;
 
   // The address of entry point relative to ImageBase. Windows executable
   // usually starts at address 0x401000.





More information about the llvm-commits mailing list