[lld] r183705 - [PECOFF][Writer] Set required OS version numbers.
Rui Ueyama
ruiu at google.com
Mon Jun 10 15:25:41 PDT 2013
Author: ruiu
Date: Mon Jun 10 17:25:41 2013
New Revision: 183705
URL: http://llvm.org/viewvc/llvm-project?rev=183705&view=rev
Log:
[PECOFF][Writer] Set required OS version numbers.
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=183705&r1=183704&r2=183705&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Mon Jun 10 17:25:41 2013
@@ -136,11 +136,14 @@ public:
// Sections in an executable file on disk should be sector-aligned (512 byte).
_peHeader.FileAlignment = 512;
- // [FIXME] Windows 5.1 is Windows XP.
- _peHeader.MajorOperatingSystemVersion = 5;
- _peHeader.MinorOperatingSystemVersion = 1;
- _peHeader.MajorSubsystemVersion = 5;
- _peHeader.MinorSubsystemVersion = 1;
+ // The required Windows version number. This is the internal version and
+ // shouldn't be confused with product name. Windows 7 is version 6.1 and
+ // Windows 8 is 6.2, for example.
+ PECOFFTargetInfo::OSVersion minOSVersion = targetInfo.getMinOSVersion();
+ _peHeader.MajorOperatingSystemVersion = minOSVersion.majorVersion;
+ _peHeader.MinorOperatingSystemVersion = minOSVersion.minorVersion;
+ _peHeader.MajorSubsystemVersion = minOSVersion.majorVersion;
+ _peHeader.MinorSubsystemVersion = minOSVersion.minorVersion;
// [FIXME] The size of the image when loaded into memory
_peHeader.SizeOfImage = 0x2000;
More information about the llvm-commits
mailing list