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 {
382 };
383 
384 enum RelocationTypesARM64 : unsigned {
403 };
404 
405 enum COMDATType : uint8_t {
413 };
414 
415 // Auxiliary Symbol Formats
421  char unused[2];
422 };
423 
425  uint8_t unused1[4];
426  uint16_t Linenumber;
427  uint8_t unused2[6];
429  uint8_t unused3[2];
430 };
431 
435  uint8_t unused[10];
436 };
437 
442 };
443 
450  uint8_t Selection;
451  char unused;
452 };
453 
455  uint8_t AuxType;
456  uint8_t unused1;
458  char unused2[12];
459 };
460 
461 union Auxiliary {
466 };
467 
468 /// The Import Directory Table.
469 ///
470 /// There is a single array of these and one entry per imported DLL.
477 };
478 
479 /// The PE32 Import Lookup Table.
480 ///
481 /// There is an array of these for each imported DLL. It represents either
482 /// the ordinal to import from the target DLL, or a name to lookup and import
483 /// from the target DLL.
484 ///
485 /// This also happens to be the same format used by the Import Address Table
486 /// when it is initially written out to the image.
489 
490  /// Is this entry specified by ordinal, or name?
491  bool isOrdinal() const { return data & 0x80000000; }
492 
493  /// Get the ordinal value of this entry. isOrdinal must be true.
494  uint16_t getOrdinal() const {
495  assert(isOrdinal() && "ILT entry is not an ordinal!");
496  return data & 0xFFFF;
497  }
498 
499  /// Set the ordinal value and set isOrdinal to true.
500  void setOrdinal(uint16_t o) {
501  data = o;
502  data |= 0x80000000;
503  }
504 
505  /// Get the Hint/Name entry RVA. isOrdinal must be false.
507  assert(!isOrdinal() && "ILT entry is not a Hint/Name RVA!");
508  return data;
509  }
510 
511  /// Set the Hint/Name entry RVA and set isOrdinal to false.
512  void setHintNameRVA(uint32_t rva) { data = rva; }
513 };
514 
515 /// The DOS compatible header at the front of all PEs.
516 struct DOSHeader {
517  uint16_t Magic;
519  uint16_t FileSizeInPages;
525  uint16_t InitialSP;
526  uint16_t Checksum;
527  uint16_t InitialIP;
530  uint16_t OverlayNumber;
531  uint16_t Reserved[4];
532  uint16_t OEMid;
533  uint16_t OEMinfo;
534  uint16_t Reserved2[10];
536 };
537 
538 struct PE32Header {
539  enum { PE32 = 0x10b, PE32_PLUS = 0x20b };
540 
541  uint16_t Magic;
563  uint16_t Subsystem;
564  // FIXME: This should be DllCharacteristics to match the COFF spec.
571  // FIXME: This should be NumberOfRvaAndSizes to match the COFF spec.
573 };
574 
578 };
579 
580 enum DataDirectoryIndex : unsigned {
596 
598 };
599 
600 enum WindowsSubsystem : unsigned {
601  IMAGE_SUBSYSTEM_UNKNOWN = 0, ///< An unknown subsystem.
602  IMAGE_SUBSYSTEM_NATIVE = 1, ///< Device drivers and native Windows processes
603  IMAGE_SUBSYSTEM_WINDOWS_GUI = 2, ///< The Windows GUI subsystem.
604  IMAGE_SUBSYSTEM_WINDOWS_CUI = 3, ///< The Windows character subsystem.
605  IMAGE_SUBSYSTEM_OS2_CUI = 5, ///< The OS/2 character subsytem.
606  IMAGE_SUBSYSTEM_POSIX_CUI = 7, ///< The POSIX character subsystem.
607  IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8, ///< Native Windows 9x driver.
608  IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9, ///< Windows CE.
609  IMAGE_SUBSYSTEM_EFI_APPLICATION = 10, ///< An EFI application.
610  IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, ///< An EFI driver with boot
611  /// services.
612  IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, ///< An EFI driver with run-time
613  /// services.
614  IMAGE_SUBSYSTEM_EFI_ROM = 13, ///< An EFI ROM image.
615  IMAGE_SUBSYSTEM_XBOX = 14, ///< XBOX.
616  IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16 ///< A BCD application.
617 };
618 
619 enum DLLCharacteristics : unsigned {
620  /// ASLR with 64 bit address space.
622  /// DLL can be relocated at load time.
624  /// Code integrity checks are enforced.
626  ///< Image is NX compatible.
628  /// Isolation aware, but do not isolate the image.
630  /// Does not use structured exception handling (SEH). No SEH handler may be
631  /// called in this image.
633  /// Do not bind the image.
635  ///< Image should execute in an AppContainer.
637  ///< A WDM driver.
639  ///< Image supports Control Flow Guard.
641  /// Terminal Server aware.
643 };
644 
645 enum DebugType : unsigned {
663 };
664 
665 enum BaseRelocationType : unsigned {
676 };
677 
678 enum ImportType : unsigned {
682 };
683 
684 enum ImportNameType : unsigned {
685  /// Import is by ordinal. This indicates that the value in the Ordinal/Hint
686  /// field of the import header is the import's ordinal. If this constant is
687  /// not specified, then the Ordinal/Hint field should always be interpreted
688  /// as the import's hint.
690  /// The import name is identical to the public symbol name
692  /// The import name is the public symbol name, but skipping the leading ?,
693  /// @, or optionally _.
695  /// The import name is the public symbol name, but skipping the leading ?,
696  /// @, or optionally _, and truncating at the first @.
698 };
699 
700 struct ImportHeader {
701  uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
702  uint16_t Sig2; ///< Must be 0xFFFF.
703  uint16_t Version;
704  uint16_t Machine;
707  uint16_t OrdinalHint;
708  uint16_t TypeInfo;
709 
710  ImportType getType() const { return static_cast<ImportType>(TypeInfo & 0x3); }
711 
713  return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
714  }
715 };
716 
720 };
721 
722 inline bool isReservedSectionNumber(int32_t SectionNumber) {
723  return SectionNumber <= 0;
724 }
725 
726 } // End namespace COFF.
727 } // End namespace llvm.
728 
729 #endif
Debugging info has been removed.
Definition: COFF.h:147
uint32_t BaseOfData
Definition: COFF.h:549
uint32_t SizeOfInitializedData
Definition: COFF.h:545
Isolation aware, but do not isolate the image.
Definition: COFF.h:629
The Windows GUI subsystem.
Definition: COFF.h:603
bool isOrdinal() const
Is this entry specified by ordinal, or name?
Definition: COFF.h:491
SymbolBaseType
Definition: COFF.h:239
uint16_t MaximumExtraParagraphs
Definition: COFF.h:523
The POSIX character subsystem.
Definition: COFF.h:606
WeakExternalCharacteristics
Definition: COFF.h:438
uint32_t NumberOfRvaAndSize
Definition: COFF.h:572
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:500
uint32_t Value
Definition: COFF.h:189
uint32_t unused2
Definition: COFF.h:85
uint16_t OrdinalHint
Definition: COFF.h:707
uint32_t SizeOfRawData
Definition: COFF.h:274
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
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:614
uint32_t unused3
Definition: COFF.h:86
uint32_t SectionAlignment
Definition: COFF.h:551
RelocationTypeI386
Definition: COFF.h:330
uint32_t SizeOfHeapReserve
Definition: COFF.h:568
AuxSymbolType
Definition: COFF.h:268
BaseRelocationType
Definition: COFF.h:665
uint32_t NumberOfSymbols
Definition: COFF.h:90
Import is by ordinal.
Definition: COFF.h:689
Used with void pointers and functions.
Definition: COFF.h:241
An EFI driver with boot services.
Definition: COFF.h:610
Code integrity checks are enforced.
Definition: COFF.h:625
ImportNameType
Definition: COFF.h:684
AuxiliarySectionDefinition SectionDefinition
Definition: COFF.h:465
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:600
uint32_t Win32VersionValue
Definition: COFF.h:559
uint32_t ImageBase
Definition: COFF.h:550
uint32_t PointerToSymbolTable
Definition: COFF.h:89
uint16_t MinorSubsystemVersion
Definition: COFF.h:558
An unsigned integer of natural size.
Definition: COFF.h:254
uint16_t Characteristics
Definition: COFF.h:72
MachineTypes
Definition: COFF.h:93
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:705
An 8-byte floating-point number.
Definition: COFF.h:247
uint32_t SizeOfStackReserve
Definition: COFF.h:566
Aggressively trim working set. This is deprecated and must be 0.
Definition: COFF.h:138
CodeViewIdentifiers
Definition: COFF.h:717
uint16_t HeaderSizeInParagraphs
Definition: COFF.h:521
DLLCharacteristics
Definition: COFF.h:619
uint32_t PointerToSymbolTable
Definition: COFF.h:69
uint32_t FileAlignment
Definition: COFF.h:552
uint16_t MajorOperatingSystemVersion
Definition: COFF.h:553
RelocationTypesARM64
Definition: COFF.h:384
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:722
uint16_t Checksum
Definition: COFF.h:526
uint16_t getOrdinal() const
Get the ordinal value of this entry. isOrdinal must be true.
Definition: COFF.h:494
uint32_t SizeOfImage
Definition: COFF.h:560
Big endian: the MSB precedes the LSB in memory.
Definition: COFF.h:160
ImportType
Definition: COFF.h:678
ASLR with 64 bit address space.
Definition: COFF.h:621
uint16_t AddressOfRelocationTable
Definition: COFF.h:529
uint32_t LoaderFlags
Definition: COFF.h:570
DataDirectoryIndex
Definition: COFF.h:580
AuxiliaryWeakExternal WeakExternal
Definition: COFF.h:464
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:547
uint16_t UsedBytesInTheLastPage
Definition: COFF.h:518
Does not use structured exception handling (SEH).
Definition: COFF.h:632
uint32_t SizeOfHeapCommit
Definition: COFF.h:569
uint16_t Machine
Definition: COFF.h:81
uint16_t NumberOfRelocationItems
Definition: COFF.h:520
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
Definition: COFF.h:265
The PE32 Import Lookup Table.
Definition: COFF.h:487
uint8_t NumberOfAuxSymbols
Definition: COFF.h:193
The DOS compatible header at the front of all PEs.
Definition: COFF.h:516
SectionCharacteristics
Definition: COFF.h:283
uint16_t MinimumExtraParagraphs
Definition: COFF.h:522
static const char ClGlObjMagic[]
Definition: COFF.h:43
RelocationTypeAMD64
Definition: COFF.h:344
uint32_t SizeOfHeaders
Definition: COFF.h:561
uint16_t OverlayNumber
Definition: COFF.h:530
uint16_t MinorOperatingSystemVersion
Definition: COFF.h:554
uint16_t SizeOfOptionalHeader
Definition: COFF.h:71
uint32_t SymbolTableIndex
Definition: COFF.h:326
uint16_t Magic
Definition: COFF.h:541
Image can handle > 2GiB addresses.
Definition: COFF.h:140
Line number, reformatted as symbol.
Definition: COFF.h:233
uint16_t OEMinfo
Definition: COFF.h:533
An array of base type.
Definition: COFF.h:262
Member of enumeration.
Definition: COFF.h:223
uint32_t BaseOfCode
Definition: COFF.h:548
void setHintNameRVA(uint32_t rva)
Set the Hint/Name entry RVA and set isOrdinal to false.
Definition: COFF.h:512
Register variable.
Definition: COFF.h:211
No type information or unknown base type.
Definition: COFF.h:240
uint16_t Subsystem
Definition: COFF.h:563
uint16_t DLLCharacteristics
Definition: COFF.h:565
Little endian: the LSB precedes the MSB in memory.
Definition: COFF.h:143
std::pair< llvm::MachO::Architecture, std::string > UUID
uint32_t getHintNameRVA() const
Get the Hint/Name entry RVA. isOrdinal must be false.
Definition: COFF.h:506
A member of enumeration (a specific value).
Definition: COFF.h:251
Native Windows 9x driver.
Definition: COFF.h:607
uint16_t NumberOfLineNumbers
Definition: COFF.h:279
uint32_t VirtualAddress
Definition: COFF.h:273
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:702
COFF line numbers have been stripped.
Definition: COFF.h:133
Device drivers and native Windows processes.
Definition: COFF.h:602
uint16_t Version
Definition: COFF.h:80
uint16_t MajorSubsystemVersion
Definition: COFF.h:557
uint32_t TimeDateStamp
Definition: COFF.h:68
ImportType getType() const
Definition: COFF.h:710
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:528
Image supports Control Flow Guard.
Definition: COFF.h:638
uint16_t InitialIP
Definition: COFF.h:527
uint32_t unused1
Definition: COFF.h:84
An enumerated type.
Definition: COFF.h:250
An EFI driver with run-time services.
Definition: COFF.h:612
uint32_t PointerToRawData
Definition: COFF.h:275
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:701
uint32_t RelativeVirtualAddress
Definition: COFF.h:576
uint32_t VirtualSize
Definition: COFF.h:272
COMDATType
Definition: COFF.h:405
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:694
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:543
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:535
uint16_t OEMid
Definition: COFF.h:532
A natural integer type on the target.
Definition: COFF.h:244
The OS/2 character subsytem.
Definition: COFF.h:605
COFF symbol table entries for local symbols have been removed.
Definition: COFF.h:136
The Import Directory Table.
Definition: COFF.h:471
uint32_t SizeOfCode
Definition: COFF.h:544
DLL can be relocated at load time.
Definition: COFF.h:623
int32_t NumberOfSections
Definition: COFF.h:67
uint32_t TimeDateStamp
Definition: COFF.h:82
uint32_t CheckSum
Definition: COFF.h:562
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:601
uint32_t SizeOfStackCommit
Definition: COFF.h:567
The import name is identical to the public symbol name.
Definition: COFF.h:691
The Windows character subsystem.
Definition: COFF.h:604
uint32_t SizeOfUninitializedData
Definition: COFF.h:546
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:645
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint16_t NumberOfRelocations
Definition: COFF.h:278
uint16_t MinorImageVersion
Definition: COFF.h:556
The import name is the public symbol name, but skipping the leading ?, @, or optionally _...
Definition: COFF.h:697
AuxiliaryFunctionDefinition FunctionDefinition
Definition: COFF.h:462
uint16_t InitialSP
Definition: COFF.h:525
SymbolSectionNumber
Definition: COFF.h:196
uint16_t Magic
Definition: COFF.h:517
A character (signed byte).
Definition: COFF.h:242
uint16_t MajorImageVersion
Definition: COFF.h:555
uint16_t InitialRelativeSS
Definition: COFF.h:524
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:706
ImportNameType getNameType() const
Definition: COFF.h:712
uint16_t FileSizeInPages
Definition: COFF.h:519
AuxiliarybfAndefSymbol bfAndefSymbol
Definition: COFF.h:463
uint32_t Characteristics
Definition: COFF.h:280
uint8_t MajorLinkerVersion
Definition: COFF.h:542
uint32_t VirtualAddress
Definition: COFF.h:325
A function that returns a base type.
Definition: COFF.h:261