[PATCH] D70464: [COFF] Widen PE32Header fields to fit 64 bit versions

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 02:10:29 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2229391eb163: [COFF] Widen PE32Header fields to fit 64 bit versions (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D70464?vs=230199&id=230405#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70464/new/

https://reviews.llvm.org/D70464

Files:
  llvm/include/llvm/BinaryFormat/COFF.h
  llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml


Index: llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml
===================================================================
--- llvm/test/tools/yaml2obj/COFF/basic-arm64.yaml
+++ 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
Index: llvm/include/llvm/BinaryFormat/COFF.h
===================================================================
--- llvm/include/llvm/BinaryFormat/COFF.h
+++ 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70464.230405.patch
Type: text/x-patch
Size: 1743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191121/7a50c4eb/attachment.bin>


More information about the llvm-commits mailing list