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