diff --git a/llvm/include/llvm/BinaryFormat/COFF.h b/llvm/include/llvm/BinaryFormat/COFF.h --- a/llvm/include/llvm/BinaryFormat/COFF.h +++ b/llvm/include/llvm/BinaryFormat/COFF.h @@ -547,7 +547,7 @@ uint32_t AddressOfEntryPoint; // RVA uint32_t BaseOfCode; // RVA uint32_t BaseOfData; // RVA - uint32_t ImageBase; + uint64_t ImageBase; uint32_t SectionAlignment; uint32_t FileAlignment; uint16_t MajorOperatingSystemVersion; @@ -563,10 +563,10 @@ uint16_t Subsystem; // FIXME: This should be DllCharacteristics to match the COFF spec. uint16_t DLLCharacteristics; - uint32_t SizeOfStackReserve; - uint32_t SizeOfStackCommit; - uint32_t SizeOfHeapReserve; - uint32_t SizeOfHeapCommit; + uint64_t SizeOfStackReserve; + uint64_t SizeOfStackCommit; + uint64_t SizeOfHeapReserve; + uint64_t SizeOfHeapCommit; uint32_t LoaderFlags; // FIXME: This should be NumberOfRvaAndSizes to match the COFF spec. uint32_t NumberOfRvaAndSize; diff --git a/llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml b/llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml --- a/llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml +++ b/llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml @@ -3,7 +3,9 @@ # RUN: obj2yaml %t | FileCheck %s --check-prefix=ROUNDTRIP # CHECK: OptionalHeaderSize: 240 +# CHECK: ImageBase: 0x140000000 +# ROUNDTRIP: ImageBase: 5368709120 # ROUNDTRIP: VirtualAddress: 4096 # ROUNDTRIP: VirtualAddress: 8192 # ROUNDTRIP: VirtualAddress: 12288 @@ -11,7 +13,7 @@ --- !COFF OptionalHeader: AddressOfEntryPoint: 4096 - ImageBase: 1073741824 + ImageBase: 5368709120 SectionAlignment: 4096 FileAlignment: 512 MajorOperatingSystemVersion: 6