mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-11 10:26:44 +00:00
[PECOFF] Set the correct PE header field value.
The charcateristics field should not have IMAGE_FILE_32BIT_MACHINE bit but have IMAGE_FILE_LARGE_ADDRESS_AWARE bit for PE32+. llvm-svn: 200518
This commit is contained in:
parent
2cbf38e36f
commit
14876abb3d
@ -331,9 +331,10 @@ PEHeaderChunk<PEHeader>::PEHeaderChunk(const PECOFFLinkingContext &ctx)
|
||||
_coffHeader.TimeDateStamp = time(nullptr);
|
||||
|
||||
// Attributes of the executable.
|
||||
uint16_t characteristics = llvm::COFF::IMAGE_FILE_32BIT_MACHINE |
|
||||
llvm::COFF::IMAGE_FILE_EXECUTABLE_IMAGE;
|
||||
if (ctx.getLargeAddressAware())
|
||||
uint16_t characteristics = llvm::COFF::IMAGE_FILE_EXECUTABLE_IMAGE;
|
||||
if (!ctx.is64Bit())
|
||||
characteristics |= llvm::COFF::IMAGE_FILE_32BIT_MACHINE;
|
||||
if (ctx.getLargeAddressAware() || ctx.is64Bit())
|
||||
characteristics |= llvm::COFF::IMAGE_FILE_LARGE_ADDRESS_AWARE;
|
||||
if (ctx.getSwapRunFromCD())
|
||||
characteristics |= llvm::COFF::IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP;
|
||||
|
@ -14,9 +14,9 @@ CHECK-NEXT: TimeDateStamp:
|
||||
CHECK-NEXT: PointerToSymbolTable: 0x0
|
||||
CHECK-NEXT: SymbolCount: 0
|
||||
CHECK-NEXT: OptionalHeaderSize: 240
|
||||
CHECK-NEXT: Characteristics [ (0x102)
|
||||
CHECK-NEXT: IMAGE_FILE_32BIT_MACHINE (0x100)
|
||||
CHECK-NEXT: Characteristics [ (0x22)
|
||||
CHECK-NEXT: IMAGE_FILE_EXECUTABLE_IMAGE (0x2)
|
||||
CHECK-NEXT: IMAGE_FILE_LARGE_ADDRESS_AWARE (0x20)
|
||||
CHECK-NEXT: ]
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: ImageOptionalHeader {
|
||||
|
Loading…
x
Reference in New Issue
Block a user