LLVM  9.0.0svn
COFF.h
Go to the documentation of this file.
1 //===-- llvm/BinaryFormat/COFF.h --------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains an definitions used in Windows COFF Files.
10 //
11 // Structures and enums defined within this file where created using
12 // information from Microsoft's publicly available PE/COFF format document:
13 //
14 // Microsoft Portable Executable and Common Object File Format Specification
15 // Revision 8.1 - February 15, 2008
16 //
17 // As of 5/2/2010, hosted by Microsoft at:
18 // http://www.microsoft.com/whdc/system/platform/firmware/pecoff.mspx
19 //
20 //===----------------------------------------------------------------------===//
21 
22 #ifndef LLVM_BINARYFORMAT_COFF_H
23 #define LLVM_BINARYFORMAT_COFF_H
24 
25 #include "llvm/Support/DataTypes.h"
26 #include <cassert>
27 #include <cstring>
28 
29 namespace llvm {
30 namespace COFF {
31 
32 // The maximum number of sections that a COFF object can have (inclusive).
33 const int32_t MaxNumberOfSections16 = 65279;
34 
35 // The PE signature bytes that follows the DOS stub header.
36 static const char PEMagic[] = {'P', 'E', '\0', '\0'};
37 
38 static const char BigObjMagic[] = {
39  '\xc7', '\xa1', '\xba', '\xd1', '\xee', '\xba', '\xa9', '\x4b',
40  '\xaf', '\x20', '\xfa', '\xf6', '\x6a', '\xa4', '\xdc', '\xb8',
41 };
42 
43 static const char ClGlObjMagic[] = {
44  '\x38', '\xfe', '\xb3', '\x0c', '\xa5', '\xd9', '\xab', '\x4d',
45  '\xac', '\x9b', '\xd6', '\xb6', '\x22', '\x26', '\x53', '\xc2',
46 };
47 
48 // The signature bytes that start a .res file.
49 static const char WinResMagic[] = {
50  '\x00', '\x00', '\x00', '\x00', '\x20', '\x00', '\x00', '\x00',
51  '\xff', '\xff', '\x00', '\x00', '\xff', '\xff', '\x00', '\x00',
52 };
53 
54 // Sizes in bytes of various things in the COFF format.
55 enum {
58  NameSize = 8,
63 };
64 
65 struct header {
66  uint16_t Machine;
72  uint16_t Characteristics;
73 };
74 
75 struct BigObjHeader {
76  enum : uint16_t { MinBigObjectVersion = 2 };
77 
78  uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
79  uint16_t Sig2; ///< Must be 0xFFFF.
80  uint16_t Version;
81  uint16_t Machine;
83  uint8_t UUID[16];
91 };
92 
93 enum MachineTypes : unsigned {
94  MT_Invalid = 0xffff,
95 
121 };
122 
123 enum Characteristics : unsigned {
125 
126  /// The file does not contain base relocations and must be loaded at its
127  /// preferred base. If this cannot be done, the loader will error.
129  /// The file is valid and can be run.
131  /// COFF line numbers have been stripped. This is deprecated and should be
132  /// 0.
134  /// COFF symbol table entries for local symbols have been removed. This is
135  /// deprecated and should be 0.
137  /// Aggressively trim working set. This is deprecated and must be 0.
139  /// Image can handle > 2GiB addresses.
141  /// Little endian: the LSB precedes the MSB in memory. This is deprecated
142  /// and should be 0.
144  /// Machine is based on a 32bit word architecture.
146  /// Debugging info has been removed.
148  /// If the image is on removable media, fully load it and copy it to swap.
150  /// If the image is on network media, fully load it and copy it to swap.
152  /// The image file is a system file, not a user program.
154  /// The image file is a DLL.
155  IMAGE_FILE_DLL = 0x2000,
156  /// This file should only be run on a uniprocessor machine.
158  /// Big endian: the MSB precedes the LSB in memory. This is deprecated
159  /// and should be 0.
161 };
162 
163 enum ResourceTypeID : unsigned {
166  RID_Icon = 3,
167  RID_Menu = 4,
171  RID_Font = 8,
180  RID_VXD = 20,
183  RID_HTML = 23,
185 };
186 
187 struct symbol {
188  char Name[NameSize];
190  int32_t SectionNumber;
191  uint16_t Type;
192  uint8_t StorageClass;
194 };
195 
196 enum SymbolSectionNumber : int32_t {
200 };
201 
202 /// Storage class tells where and what the symbol represents
204  SSC_Invalid = 0xff,
205 
206  IMAGE_SYM_CLASS_END_OF_FUNCTION = -1, ///< Physical end of function
207  IMAGE_SYM_CLASS_NULL = 0, ///< No symbol
208  IMAGE_SYM_CLASS_AUTOMATIC = 1, ///< Stack variable
209  IMAGE_SYM_CLASS_EXTERNAL = 2, ///< External symbol
210  IMAGE_SYM_CLASS_STATIC = 3, ///< Static
211  IMAGE_SYM_CLASS_REGISTER = 4, ///< Register variable
212  IMAGE_SYM_CLASS_EXTERNAL_DEF = 5, ///< External definition
213  IMAGE_SYM_CLASS_LABEL = 6, ///< Label
214  IMAGE_SYM_CLASS_UNDEFINED_LABEL = 7, ///< Undefined label
215  IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = 8, ///< Member of structure
216  IMAGE_SYM_CLASS_ARGUMENT = 9, ///< Function argument
217  IMAGE_SYM_CLASS_STRUCT_TAG = 10, ///< Structure tag
218  IMAGE_SYM_CLASS_MEMBER_OF_UNION = 11, ///< Member of union
219  IMAGE_SYM_CLASS_UNION_TAG = 12, ///< Union tag
220  IMAGE_SYM_CLASS_TYPE_DEFINITION = 13, ///< Type definition
221  IMAGE_SYM_CLASS_UNDEFINED_STATIC = 14, ///< Undefined static
222  IMAGE_SYM_CLASS_ENUM_TAG = 15, ///< Enumeration tag
223  IMAGE_SYM_CLASS_MEMBER_OF_ENUM = 16, ///< Member of enumeration
224  IMAGE_SYM_CLASS_REGISTER_PARAM = 17, ///< Register parameter
225  IMAGE_SYM_CLASS_BIT_FIELD = 18, ///< Bit field
226  /// ".bb" or ".eb" - beginning or end of block
228  /// ".bf" or ".ef" - beginning or end of function
230  IMAGE_SYM_CLASS_END_OF_STRUCT = 102, ///< End of structure
231  IMAGE_SYM_CLASS_FILE = 103, ///< File name
232  /// Line number, reformatted as symbol
234  IMAGE_SYM_CLASS_WEAK_EXTERNAL = 105, ///< Duplicate tag
235  /// External symbol in dmert public lib
237 };
238 
239 enum SymbolBaseType : unsigned {
240  IMAGE_SYM_TYPE_NULL = 0, ///< No type information or unknown base type.
241  IMAGE_SYM_TYPE_VOID = 1, ///< Used with void pointers and functions.
242  IMAGE_SYM_TYPE_CHAR = 2, ///< A character (signed byte).
243  IMAGE_SYM_TYPE_SHORT = 3, ///< A 2-byte signed integer.
244  IMAGE_SYM_TYPE_INT = 4, ///< A natural integer type on the target.
245  IMAGE_SYM_TYPE_LONG = 5, ///< A 4-byte signed integer.
246  IMAGE_SYM_TYPE_FLOAT = 6, ///< A 4-byte floating-point number.
247  IMAGE_SYM_TYPE_DOUBLE = 7, ///< An 8-byte floating-point number.
248  IMAGE_SYM_TYPE_STRUCT = 8, ///< A structure.
249  IMAGE_SYM_TYPE_UNION = 9, ///< An union.
250  IMAGE_SYM_TYPE_ENUM = 10, ///< An enumerated type.
251  IMAGE_SYM_TYPE_MOE = 11, ///< A member of enumeration (a specific value).
252  IMAGE_SYM_TYPE_BYTE = 12, ///< A byte; unsigned 1-byte integer.
253  IMAGE_SYM_TYPE_WORD = 13, ///< A word; unsigned 2-byte integer.
254  IMAGE_SYM_TYPE_UINT = 14, ///< An unsigned integer of natural size.
255  IMAGE_SYM_TYPE_DWORD = 15 ///< An unsigned 4-byte integer.
256 };
257 
258 enum SymbolComplexType : unsigned {
259  IMAGE_SYM_DTYPE_NULL = 0, ///< No complex type; simple scalar variable.
260  IMAGE_SYM_DTYPE_POINTER = 1, ///< A pointer to base type.
261  IMAGE_SYM_DTYPE_FUNCTION = 2, ///< A function that returns a base type.
262  IMAGE_SYM_DTYPE_ARRAY = 3, ///< An array of base type.
263 
264  /// Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
266 };
267 
269 
270 struct section {
271  char Name[NameSize];
281 };
282 
284  SC_Invalid = 0xffffffff,
285 
286  IMAGE_SCN_TYPE_NOLOAD = 0x00000002,
287  IMAGE_SCN_TYPE_NO_PAD = 0x00000008,
288  IMAGE_SCN_CNT_CODE = 0x00000020,
291  IMAGE_SCN_LNK_OTHER = 0x00000100,
292  IMAGE_SCN_LNK_INFO = 0x00000200,
293  IMAGE_SCN_LNK_REMOVE = 0x00000800,
294  IMAGE_SCN_LNK_COMDAT = 0x00001000,
295  IMAGE_SCN_GPREL = 0x00008000,
297  IMAGE_SCN_MEM_16BIT = 0x00020000,
298  IMAGE_SCN_MEM_LOCKED = 0x00040000,
299  IMAGE_SCN_MEM_PRELOAD = 0x00080000,
318  IMAGE_SCN_MEM_SHARED = 0x10000000,
319  IMAGE_SCN_MEM_EXECUTE = 0x20000000,
320  IMAGE_SCN_MEM_READ = 0x40000000,
321  IMAGE_SCN_MEM_WRITE = 0x80000000
322 };
323 
324 struct relocation {
327  uint16_t Type;
328 };
329 
330 enum RelocationTypeI386 : unsigned {
342 };
343 
344 enum RelocationTypeAMD64 : unsigned {
362 };
363 
364 enum RelocationTypesARM : unsigned {
380 };
381 
382 enum RelocationTypesARM64 : unsigned {
400 };
401 
402 enum COMDATType : unsigned {
410 };
411 
412 // Auxiliary Symbol Formats
418  char unused[2];
419 };
420 
422  uint8_t unused1[4];
423  uint16_t Linenumber;
424  uint8_t unused2[6];
426  uint8_t unused3[2];
427 };
428 
432  uint8_t unused[10];
433 };
434 
439 };
440 
447  uint8_t Selection;
448  char unused;
449 };
450 
452  uint8_t AuxType;
453  uint8_t unused1;
455  char unused2[12];
456 };
457 
458 union Auxiliary {
463 };
464 
465 /// The Import Directory Table.
466 ///
467 /// There is a single array of these and one entry per imported DLL.
474 };
475 
476 /// The PE32 Import Lookup Table.
477 ///
478 /// There is an array of these for each imported DLL. It represents either
479 /// the ordinal to import from the target DLL, or a name to lookup and import
480 /// from the target DLL.
481 ///
482 /// This also happens to be the same format used by the Import Address Table
483 /// when it is initially written out to the image.
486 
487  /// Is this entry specified by ordinal, or name?
488  bool isOrdinal() const { return data & 0x80000000; }
489 
490  /// Get the ordinal value of this entry. isOrdinal must be true.
491  uint16_t getOrdinal() const {
492  assert(isOrdinal() && "ILT entry is not an ordinal!");
493  return data & 0xFFFF;
494  }
495 
496  /// Set the ordinal value and set isOrdinal to true.
497  void setOrdinal(uint16_t o) {
498  data = o;
499  data |= 0x80000000;
500  }
501 
502  /// Get the Hint/Name entry RVA. isOrdinal must be false.
504  assert(!isOrdinal() && "ILT entry is not a Hint/Name RVA!");
505  return data;
506  }
507 
508  /// Set the Hint/Name entry RVA and set isOrdinal to false.
509  void setHintNameRVA(uint32_t rva) { data = rva; }
510 };
511 
512 /// The DOS compatible header at the front of all PEs.
513 struct DOSHeader {
514  uint16_t Magic;
516  uint16_t FileSizeInPages;
522  uint16_t InitialSP;
523  uint16_t Checksum;
524  uint16_t InitialIP;
527  uint16_t OverlayNumber;
528  uint16_t Reserved[4];
529  uint16_t OEMid;
530  uint16_t OEMinfo;
531  uint16_t Reserved2[10];
533 };
534 
535 struct PE32Header {
536  enum { PE32 = 0x10b, PE32_PLUS = 0x20b };
537 
538  uint16_t Magic;
560  uint16_t Subsystem;
561  // FIXME: This should be DllCharacteristics to match the COFF spec.
568  // FIXME: This should be NumberOfRvaAndSizes to match the COFF spec.
570 };
571 
575 };
576 
577 enum DataDirectoryIndex : unsigned {
593 
595 };
596 
597 enum WindowsSubsystem : unsigned {
598  IMAGE_SUBSYSTEM_UNKNOWN = 0, ///< An unknown subsystem.
599  IMAGE_SUBSYSTEM_NATIVE = 1, ///< Device drivers and native Windows processes
600  IMAGE_SUBSYSTEM_WINDOWS_GUI = 2, ///< The Windows GUI subsystem.
601  IMAGE_SUBSYSTEM_WINDOWS_CUI = 3, ///< The Windows character subsystem.
602  IMAGE_SUBSYSTEM_OS2_CUI = 5, ///< The OS/2 character subsytem.
603  IMAGE_SUBSYSTEM_POSIX_CUI = 7, ///< The POSIX character subsystem.
604  IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8, ///< Native Windows 9x driver.
605  IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9, ///< Windows CE.
606  IMAGE_SUBSYSTEM_EFI_APPLICATION = 10, ///< An EFI application.
607  IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, ///< An EFI driver with boot
608  /// services.
609  IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, ///< An EFI driver with run-time
610  /// services.
611  IMAGE_SUBSYSTEM_EFI_ROM = 13, ///< An EFI ROM image.
612  IMAGE_SUBSYSTEM_XBOX = 14, ///< XBOX.
613  IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16 ///< A BCD application.
614 };
615 
616 enum DLLCharacteristics : unsigned {
617  /// ASLR with 64 bit address space.
619  /// DLL can be relocated at load time.
621  /// Code integrity checks are enforced.
623  ///< Image is NX compatible.
625  /// Isolation aware, but do not isolate the image.
627  /// Does not use structured exception handling (SEH). No SEH handler may be
628  /// called in this image.
630  /// Do not bind the image.
632  ///< Image should execute in an AppContainer.
634  ///< A WDM driver.
636  ///< Image supports Control Flow Guard.
638  /// Terminal Server aware.
640 };
641 
642 enum DebugType : unsigned {
660 };
661 
662 enum BaseRelocationType : unsigned {
673 };
674 
675 enum ImportType : unsigned {
679 };
680 
681 enum ImportNameType : unsigned {
682  /// Import is by ordinal. This indicates that the value in the Ordinal/Hint
683  /// field of the import header is the import's ordinal. If this constant is
684  /// not specified, then the Ordinal/Hint field should always be interpreted
685  /// as the import's hint.
687  /// The import name is identical to the public symbol name
689  /// The import name is the public symbol name, but skipping the leading ?,
690  /// @, or optionally _.
692  /// The import name is the public symbol name, but skipping the leading ?,
693  /// @, or optionally _, and truncating at the first @.
695 };
696 
697 struct ImportHeader {
698  uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
699  uint16_t Sig2; ///< Must be 0xFFFF.
700  uint16_t Version;
701  uint16_t Machine;
704  uint16_t OrdinalHint;
705  uint16_t TypeInfo;
706 
707  ImportType getType() const { return static_cast<ImportType>(TypeInfo & 0x3); }
708 
710  return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
711  }
712 };
713 
717 };
718 
719 inline bool isReservedSectionNumber(int32_t SectionNumber) {
720  return SectionNumber <= 0;
721 }
722 
723 } // End namespace COFF.
724 } // End namespace llvm.
725 
726 #endif
Debugging info has been removed.
Definition: COFF.h:147
uint32_t BaseOfData
Definition: COFF.h:546
uint32_t SizeOfInitializedData
Definition: COFF.h:542
Isolation aware, but do not isolate the image.
Definition: COFF.h:626
The Windows GUI subsystem.
Definition: COFF.h:600
bool isOrdinal() const
Is this entry specified by ordinal, or name?
Definition: COFF.h:488
SymbolBaseType
Definition: COFF.h:239
uint16_t MaximumExtraParagraphs
Definition: COFF.h:520
The POSIX character subsystem.
Definition: COFF.h:603
WeakExternalCharacteristics
Definition: COFF.h:435
uint32_t NumberOfRvaAndSize
Definition: COFF.h:569
This class represents lattice values for constants.
Definition: AllocatorList.h:23
int32_t SectionNumber
Definition: COFF.h:190
void setOrdinal(uint16_t o)
Set the ordinal value and set isOrdinal to true.
Definition: COFF.h:497
uint32_t Value
Definition: COFF.h:189
uint32_t unused2
Definition: COFF.h:85
uint16_t OrdinalHint
Definition: COFF.h:704
uint32_t SizeOfRawData
Definition: COFF.h:274
uint16_t Type
Definition: COFF.h:191
Physical end of function.
Definition: COFF.h:206
The image file is a DLL.
Definition: COFF.h:155
An EFI ROM image.
Definition: COFF.h:611
uint32_t unused3
Definition: COFF.h:86
uint32_t SectionAlignment
Definition: COFF.h:548
RelocationTypeI386
Definition: COFF.h:330
uint32_t SizeOfHeapReserve
Definition: COFF.h:565
AuxSymbolType
Definition: COFF.h:268
BaseRelocationType
Definition: COFF.h:662
uint32_t NumberOfSymbols
Definition: COFF.h:90
Import is by ordinal.
Definition: COFF.h:686
Used with void pointers and functions.
Definition: COFF.h:241
An EFI driver with boot services.
Definition: COFF.h:607
Code integrity checks are enforced.
Definition: COFF.h:622
ImportNameType
Definition: COFF.h:681
AuxiliarySectionDefinition SectionDefinition
Definition: COFF.h:462
No complex type; simple scalar variable.
Definition: COFF.h:259
A pointer to base type.
Definition: COFF.h:260
uint16_t Machine
Definition: COFF.h:66
static const char BigObjMagic[]
Definition: COFF.h:38
WindowsSubsystem
Definition: COFF.h:597
uint32_t Win32VersionValue
Definition: COFF.h:556
uint32_t ImageBase
Definition: COFF.h:547
uint32_t PointerToSymbolTable
Definition: COFF.h:89
uint16_t MinorSubsystemVersion
Definition: COFF.h:555
An unsigned integer of natural size.
Definition: COFF.h:254
uint16_t Characteristics
Definition: COFF.h:72
MachineTypes
Definition: COFF.h:93
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Machine is based on a 32bit word architecture.
Definition: COFF.h:145
uint32_t NumberOfSections
Definition: COFF.h:88
".bf" or ".ef" - beginning or end of function
Definition: COFF.h:229
uint32_t TimeDateStamp
Definition: COFF.h:702
An 8-byte floating-point number.
Definition: COFF.h:247
uint32_t SizeOfStackReserve
Definition: COFF.h:563
Aggressively trim working set. This is deprecated and must be 0.
Definition: COFF.h:138
CodeViewIdentifiers
Definition: COFF.h:714
uint16_t HeaderSizeInParagraphs
Definition: COFF.h:518
DLLCharacteristics
Definition: COFF.h:616
uint32_t PointerToSymbolTable
Definition: COFF.h:69
uint32_t FileAlignment
Definition: COFF.h:549
uint16_t MajorOperatingSystemVersion
Definition: COFF.h:550
RelocationTypesARM64
Definition: COFF.h:382
An unsigned 4-byte integer.
Definition: COFF.h:255
const int32_t MaxNumberOfSections16
Definition: COFF.h:33
External symbol in dmert public lib.
Definition: COFF.h:236
bool isReservedSectionNumber(int32_t SectionNumber)
Definition: COFF.h:719
uint16_t Checksum
Definition: COFF.h:523
uint16_t getOrdinal() const
Get the ordinal value of this entry. isOrdinal must be true.
Definition: COFF.h:491
uint32_t SizeOfImage
Definition: COFF.h:557
Big endian: the MSB precedes the LSB in memory.
Definition: COFF.h:160
ImportType
Definition: COFF.h:675
ASLR with 64 bit address space.
Definition: COFF.h:618
uint16_t AddressOfRelocationTable
Definition: COFF.h:526
uint32_t LoaderFlags
Definition: COFF.h:567
DataDirectoryIndex
Definition: COFF.h:577
AuxiliaryWeakExternal WeakExternal
Definition: COFF.h:461
The file does not contain base relocations and must be loaded at its preferred base.
Definition: COFF.h:128
uint32_t AddressOfEntryPoint
Definition: COFF.h:544
uint16_t UsedBytesInTheLastPage
Definition: COFF.h:515
Does not use structured exception handling (SEH).
Definition: COFF.h:629
uint32_t SizeOfHeapCommit
Definition: COFF.h:566
uint16_t Machine
Definition: COFF.h:81
uint16_t NumberOfRelocationItems
Definition: COFF.h:517
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
Definition: COFF.h:265
The PE32 Import Lookup Table.
Definition: COFF.h:484
uint8_t NumberOfAuxSymbols
Definition: COFF.h:193
The DOS compatible header at the front of all PEs.
Definition: COFF.h:513
SectionCharacteristics
Definition: COFF.h:283
uint16_t MinimumExtraParagraphs
Definition: COFF.h:519
static const char ClGlObjMagic[]
Definition: COFF.h:43
RelocationTypeAMD64
Definition: COFF.h:344
uint32_t SizeOfHeaders
Definition: COFF.h:558
uint16_t OverlayNumber
Definition: COFF.h:527
uint16_t MinorOperatingSystemVersion
Definition: COFF.h:551
uint16_t SizeOfOptionalHeader
Definition: COFF.h:71
uint32_t SymbolTableIndex
Definition: COFF.h:326
uint16_t Magic
Definition: COFF.h:538
Image can handle > 2GiB addresses.
Definition: COFF.h:140
Line number, reformatted as symbol.
Definition: COFF.h:233
uint16_t OEMinfo
Definition: COFF.h:530
An array of base type.
Definition: COFF.h:262
Member of enumeration.
Definition: COFF.h:223
uint32_t BaseOfCode
Definition: COFF.h:545
void setHintNameRVA(uint32_t rva)
Set the Hint/Name entry RVA and set isOrdinal to false.
Definition: COFF.h:509
Register variable.
Definition: COFF.h:211
No type information or unknown base type.
Definition: COFF.h:240
uint16_t Subsystem
Definition: COFF.h:560
uint16_t DLLCharacteristics
Definition: COFF.h:562
Little endian: the LSB precedes the MSB in memory.
Definition: COFF.h:143
uint32_t getHintNameRVA() const
Get the Hint/Name entry RVA. isOrdinal must be false.
Definition: COFF.h:503
A member of enumeration (a specific value).
Definition: COFF.h:251
Native Windows 9x driver.
Definition: COFF.h:604
uint16_t NumberOfLineNumbers
Definition: COFF.h:279
uint32_t VirtualAddress
Definition: COFF.h:273
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:699
COFF line numbers have been stripped.
Definition: COFF.h:133
Device drivers and native Windows processes.
Definition: COFF.h:599
uint16_t Version
Definition: COFF.h:80
uint16_t MajorSubsystemVersion
Definition: COFF.h:554
uint32_t TimeDateStamp
Definition: COFF.h:68
ImportType getType() const
Definition: COFF.h:707
The image file is a system file, not a user program.
Definition: COFF.h:153
uint32_t PointerToRelocations
Definition: COFF.h:276
ResourceTypeID
Definition: COFF.h:163
A 4-byte signed integer.
Definition: COFF.h:245
uint16_t InitialRelativeCS
Definition: COFF.h:525
Image supports Control Flow Guard.
Definition: COFF.h:635
uint16_t InitialIP
Definition: COFF.h:524
uint32_t unused1
Definition: COFF.h:84
An enumerated type.
Definition: COFF.h:250
An EFI driver with run-time services.
Definition: COFF.h:609
uint32_t PointerToRawData
Definition: COFF.h:275
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:698
uint32_t RelativeVirtualAddress
Definition: COFF.h:573
uint32_t VirtualSize
Definition: COFF.h:272
SymbolStorageClass
Storage class tells where and what the symbol represents.
Definition: COFF.h:203
".bb" or ".eb" - beginning or end of block
Definition: COFF.h:227
A 2-byte signed integer.
Definition: COFF.h:243
The import name is the public symbol name, but skipping the leading ?, @, or optionally _...
Definition: COFF.h:691
A byte; unsigned 1-byte integer.
Definition: COFF.h:252
Function argument.
Definition: COFF.h:216
If the image is on removable media, fully load it and copy it to swap.
Definition: COFF.h:149
uint8_t MinorLinkerVersion
Definition: COFF.h:540
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:79
If the image is on network media, fully load it and copy it to swap.
Definition: COFF.h:151
uint32_t NumberOfSymbols
Definition: COFF.h:70
The file is valid and can be run.
Definition: COFF.h:130
uint32_t AddressOfNewExeHeader
Definition: COFF.h:532
uint16_t OEMid
Definition: COFF.h:529
A natural integer type on the target.
Definition: COFF.h:244
The OS/2 character subsytem.
Definition: COFF.h:602
COFF symbol table entries for local symbols have been removed.
Definition: COFF.h:136
The Import Directory Table.
Definition: COFF.h:468
uint32_t SizeOfCode
Definition: COFF.h:541
DLL can be relocated at load time.
Definition: COFF.h:620
int32_t NumberOfSections
Definition: COFF.h:67
uint32_t TimeDateStamp
Definition: COFF.h:82
uint32_t CheckSum
Definition: COFF.h:559
This file should only be run on a uniprocessor machine.
Definition: COFF.h:157
RelocationTypesARM
Definition: COFF.h:364
A 4-byte floating-point number.
Definition: COFF.h:246
A word; unsigned 2-byte integer.
Definition: COFF.h:253
static const char PEMagic[]
Definition: COFF.h:36
An unknown subsystem.
Definition: COFF.h:598
COMDATType
Definition: COFF.h:402
uint32_t SizeOfStackCommit
Definition: COFF.h:564
The import name is identical to the public symbol name.
Definition: COFF.h:688
The Windows character subsystem.
Definition: COFF.h:601
uint32_t SizeOfUninitializedData
Definition: COFF.h:543
uint8_t StorageClass
Definition: COFF.h:192
uint32_t unused4
Definition: COFF.h:87
static const char WinResMagic[]
Definition: COFF.h:49
DebugType
Definition: COFF.h:642
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint16_t NumberOfRelocations
Definition: COFF.h:278
uint16_t MinorImageVersion
Definition: COFF.h:553
The import name is the public symbol name, but skipping the leading ?, @, or optionally _...
Definition: COFF.h:694
AuxiliaryFunctionDefinition FunctionDefinition
Definition: COFF.h:459
uint16_t InitialSP
Definition: COFF.h:522
SymbolSectionNumber
Definition: COFF.h:196
uint16_t Magic
Definition: COFF.h:514
A character (signed byte).
Definition: COFF.h:242
uint16_t MajorImageVersion
Definition: COFF.h:552
uint16_t InitialRelativeSS
Definition: COFF.h:521
uint32_t PointerToLineNumbers
Definition: COFF.h:277
SymbolComplexType
Definition: COFF.h:258
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:78
uint32_t SizeOfData
Definition: COFF.h:703
ImportNameType getNameType() const
Definition: COFF.h:709
uint16_t FileSizeInPages
Definition: COFF.h:516
AuxiliarybfAndefSymbol bfAndefSymbol
Definition: COFF.h:460
uint32_t Characteristics
Definition: COFF.h:280
uint8_t MajorLinkerVersion
Definition: COFF.h:539
uint32_t VirtualAddress
Definition: COFF.h:325
A function that returns a base type.
Definition: COFF.h:261