llvm.org GIT mirror llvm / 4616e2f
[yaml2obj] Treat COFF/ARM64 as a 64 bit architecture Differential Revision: https://reviews.llvm.org/D54935 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347703 91177308-0d34-0410-b5e6-96231b3b80d8 Martin Storsjo 9 months ago
2 changed file(s) with 91 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 # RUN: yaml2obj %s -o %t
1 # RUN: llvm-readobj -file-headers %t | FileCheck %s
2
3 # CHECK: OptionalHeaderSize: 240
4
5 --- !COFF
6 OptionalHeader:
7 AddressOfEntryPoint: 4096
8 ImageBase: 1073741824
9 SectionAlignment: 4096
10 FileAlignment: 512
11 MajorOperatingSystemVersion: 6
12 MinorOperatingSystemVersion: 0
13 MajorImageVersion: 0
14 MinorImageVersion: 0
15 MajorSubsystemVersion: 6
16 MinorSubsystemVersion: 0
17 Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
18 DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
19 SizeOfStackReserve: 1048576
20 SizeOfStackCommit: 4096
21 SizeOfHeapReserve: 1048576
22 SizeOfHeapCommit: 4096
23 ExportTable:
24 RelativeVirtualAddress: 0
25 Size: 0
26 ImportTable:
27 RelativeVirtualAddress: 0
28 Size: 0
29 ResourceTable:
30 RelativeVirtualAddress: 0
31 Size: 0
32 ExceptionTable:
33 RelativeVirtualAddress: 12288
34 Size: 8
35 CertificateTable:
36 RelativeVirtualAddress: 0
37 Size: 0
38 BaseRelocationTable:
39 RelativeVirtualAddress: 0
40 Size: 0
41 Debug:
42 RelativeVirtualAddress: 0
43 Size: 0
44 Architecture:
45 RelativeVirtualAddress: 0
46 Size: 0
47 GlobalPtr:
48 RelativeVirtualAddress: 0
49 Size: 0
50 TlsTable:
51 RelativeVirtualAddress: 0
52 Size: 0
53 LoadConfigTable:
54 RelativeVirtualAddress: 0
55 Size: 0
56 BoundImport:
57 RelativeVirtualAddress: 0
58 Size: 0
59 IAT:
60 RelativeVirtualAddress: 0
61 Size: 0
62 DelayImportDescriptor:
63 RelativeVirtualAddress: 0
64 Size: 0
65 ClrRuntimeHeader:
66 RelativeVirtualAddress: 0
67 Size: 0
68 header:
69 Machine: IMAGE_FILE_MACHINE_ARM64
70 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
71 sections:
72 - Name: .text
73 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
74 VirtualAddress: 1073745920
75 VirtualSize: 4
76 SectionData: C0035FD6
77 - Name: .rdata
78 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
79 VirtualAddress: 1073750016
80 VirtualSize: 12
81 SectionData: 0100400800000000E4E3E3E3
82 - Name: .pdata
83 Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
84 VirtualAddress: 1073754112
85 VirtualSize: 8
86 SectionData: '0010000000200000'
87 symbols: []
88 ...
4545
4646 bool isPE() const { return Obj.OptionalHeader.hasValue(); }
4747 bool is64Bit() const {
48 return Obj.Header.Machine == COFF::IMAGE_FILE_MACHINE_AMD64;
48 return Obj.Header.Machine == COFF::IMAGE_FILE_MACHINE_AMD64 ||
49 Obj.Header.Machine == COFF::IMAGE_FILE_MACHINE_ARM64;
4950 }
5051
5152 uint32_t getFileAlignment() const {