LLVM 22.0.0git
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
27#include <cassert>
28
29namespace llvm {
30namespace COFF {
31
32// The maximum number of sections that a COFF object can have (inclusive).
33const int32_t MaxNumberOfSections16 = 65279;
34
35// The PE signature bytes that follows the DOS stub header.
36static const char PEMagic[] = {'P', 'E', '\0', '\0'};
37
38static const char BigObjMagic[] = {
39 '\xc7', '\xa1', '\xba', '\xd1', '\xee', '\xba', '\xa9', '\x4b',
40 '\xaf', '\x20', '\xfa', '\xf6', '\x6a', '\xa4', '\xdc', '\xb8',
41};
42
43static 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.
49static 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.
55enum {
63};
64
65struct header {
73};
74
77
78 uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
79 uint16_t Sig2; ///< Must be 0xFFFF.
91};
92
93enum MachineTypes : unsigned {
94 MT_Invalid = 0xffff,
95
124
125template <typename T> bool isArm64EC(T Machine) {
128}
129
130template <typename T> bool isAnyArm64(T Machine) {
132}
133
134template <typename T> bool is64Bit(T Machine) {
136}
137
138enum Characteristics : unsigned {
140
141 /// The file does not contain base relocations and must be loaded at its
142 /// preferred base. If this cannot be done, the loader will error.
144 /// The file is valid and can be run.
146 /// COFF line numbers have been stripped. This is deprecated and should be
147 /// 0.
149 /// COFF symbol table entries for local symbols have been removed. This is
150 /// deprecated and should be 0.
152 /// Aggressively trim working set. This is deprecated and must be 0.
154 /// Image can handle > 2GiB addresses.
156 /// Little endian: the LSB precedes the MSB in memory. This is deprecated
157 /// and should be 0.
159 /// Machine is based on a 32bit word architecture.
161 /// Debugging info has been removed.
163 /// If the image is on removable media, fully load it and copy it to swap.
165 /// If the image is on network media, fully load it and copy it to swap.
167 /// The image file is a system file, not a user program.
169 /// The image file is a DLL.
171 /// This file should only be run on a uniprocessor machine.
173 /// Big endian: the MSB precedes the LSB in memory. This is deprecated
174 /// and should be 0.
177
178enum ResourceTypeID : unsigned {
200};
201
202struct symbol {
209};
210
211enum SymbolSectionNumber : int32_t {
216
217/// Storage class tells where and what the symbol represents
220
221 IMAGE_SYM_CLASS_END_OF_FUNCTION = -1, ///< Physical end of function
222 IMAGE_SYM_CLASS_NULL = 0, ///< No symbol
223 IMAGE_SYM_CLASS_AUTOMATIC = 1, ///< Stack variable
224 IMAGE_SYM_CLASS_EXTERNAL = 2, ///< External symbol
225 IMAGE_SYM_CLASS_STATIC = 3, ///< Static
226 IMAGE_SYM_CLASS_REGISTER = 4, ///< Register variable
227 IMAGE_SYM_CLASS_EXTERNAL_DEF = 5, ///< External definition
228 IMAGE_SYM_CLASS_LABEL = 6, ///< Label
229 IMAGE_SYM_CLASS_UNDEFINED_LABEL = 7, ///< Undefined label
230 IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = 8, ///< Member of structure
231 IMAGE_SYM_CLASS_ARGUMENT = 9, ///< Function argument
232 IMAGE_SYM_CLASS_STRUCT_TAG = 10, ///< Structure tag
233 IMAGE_SYM_CLASS_MEMBER_OF_UNION = 11, ///< Member of union
234 IMAGE_SYM_CLASS_UNION_TAG = 12, ///< Union tag
235 IMAGE_SYM_CLASS_TYPE_DEFINITION = 13, ///< Type definition
236 IMAGE_SYM_CLASS_UNDEFINED_STATIC = 14, ///< Undefined static
237 IMAGE_SYM_CLASS_ENUM_TAG = 15, ///< Enumeration tag
238 IMAGE_SYM_CLASS_MEMBER_OF_ENUM = 16, ///< Member of enumeration
239 IMAGE_SYM_CLASS_REGISTER_PARAM = 17, ///< Register parameter
240 IMAGE_SYM_CLASS_BIT_FIELD = 18, ///< Bit field
241 /// ".bb" or ".eb" - beginning or end of block
243 /// ".bf" or ".ef" - beginning or end of function
245 IMAGE_SYM_CLASS_END_OF_STRUCT = 102, ///< End of structure
246 IMAGE_SYM_CLASS_FILE = 103, ///< File name
247 /// Line number, reformatted as symbol
249 IMAGE_SYM_CLASS_WEAK_EXTERNAL = 105, ///< Duplicate tag
250 /// External symbol in dmert public lib
253
254enum SymbolBaseType : unsigned {
255 IMAGE_SYM_TYPE_NULL = 0, ///< No type information or unknown base type.
256 IMAGE_SYM_TYPE_VOID = 1, ///< Used with void pointers and functions.
257 IMAGE_SYM_TYPE_CHAR = 2, ///< A character (signed byte).
258 IMAGE_SYM_TYPE_SHORT = 3, ///< A 2-byte signed integer.
259 IMAGE_SYM_TYPE_INT = 4, ///< A natural integer type on the target.
260 IMAGE_SYM_TYPE_LONG = 5, ///< A 4-byte signed integer.
261 IMAGE_SYM_TYPE_FLOAT = 6, ///< A 4-byte floating-point number.
262 IMAGE_SYM_TYPE_DOUBLE = 7, ///< An 8-byte floating-point number.
263 IMAGE_SYM_TYPE_STRUCT = 8, ///< A structure.
264 IMAGE_SYM_TYPE_UNION = 9, ///< An union.
265 IMAGE_SYM_TYPE_ENUM = 10, ///< An enumerated type.
266 IMAGE_SYM_TYPE_MOE = 11, ///< A member of enumeration (a specific value).
267 IMAGE_SYM_TYPE_BYTE = 12, ///< A byte; unsigned 1-byte integer.
268 IMAGE_SYM_TYPE_WORD = 13, ///< A word; unsigned 2-byte integer.
269 IMAGE_SYM_TYPE_UINT = 14, ///< An unsigned integer of natural size.
270 IMAGE_SYM_TYPE_DWORD = 15 ///< An unsigned 4-byte integer.
272
273enum SymbolComplexType : unsigned {
274 IMAGE_SYM_DTYPE_NULL = 0, ///< No complex type; simple scalar variable.
275 IMAGE_SYM_DTYPE_POINTER = 1, ///< A pointer to base type.
276 IMAGE_SYM_DTYPE_FUNCTION = 2, ///< A function that returns a base type.
277 IMAGE_SYM_DTYPE_ARRAY = 3, ///< An array of base type.
278
279 /// Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
282
284
285struct section {
296};
297
299 SC_Invalid = 0xffffffff,
300
303 IMAGE_SCN_CNT_CODE = 0x00000020,
307 IMAGE_SCN_LNK_INFO = 0x00000200,
310 IMAGE_SCN_GPREL = 0x00008000,
336 IMAGE_SCN_MEM_READ = 0x40000000,
337 IMAGE_SCN_MEM_WRITE = 0x80000000
339
344};
345
346enum RelocationTypeI386 : unsigned {
357 IMAGE_REL_I386_REL32 = 0x0014
359
360enum RelocationTypeAMD64 : unsigned {
379
380enum RelocationTypesARM : unsigned {
398};
399
400enum RelocationTypesARM64 : unsigned {
419};
420
421enum RelocationTypesMips : unsigned {
437};
438
439enum DynamicRelocationType : unsigned {
446};
447
452};
453
463
464// Auxiliary Symbol Formats
470 char unused[2];
471};
472
479};
480
485};
486
493
501 char unused;
502};
503
508 char unused2[12];
509};
510
516};
517
518/// The Import Directory Table.
519///
520/// There is a single array of these and one entry per imported DLL.
527};
528
529/// The PE32 Import Lookup Table.
530///
531/// There is an array of these for each imported DLL. It represents either
532/// the ordinal to import from the target DLL, or a name to lookup and import
533/// from the target DLL.
534///
535/// This also happens to be the same format used by the Import Address Table
536/// when it is initially written out to the image.
539
540 /// Is this entry specified by ordinal, or name?
541 bool isOrdinal() const { return data & 0x80000000; }
542
543 /// Get the ordinal value of this entry. isOrdinal must be true.
545 assert(isOrdinal() && "ILT entry is not an ordinal!");
546 return data & 0xFFFF;
547 }
548
549 /// Set the ordinal value and set isOrdinal to true.
551 data = o;
552 data |= 0x80000000;
553 }
554
555 /// Get the Hint/Name entry RVA. isOrdinal must be false.
557 assert(!isOrdinal() && "ILT entry is not a Hint/Name RVA!");
558 return data;
559 }
560
561 /// Set the Hint/Name entry RVA and set isOrdinal to false.
562 void setHintNameRVA(uint32_t rva) { data = rva; }
563};
564
565/// The DOS compatible header at the front of all PEs.
566struct DOSHeader {
586};
587
589 enum { PE32 = 0x10b, PE32_PLUS = 0x20b };
590
614 // FIXME: This should be DllCharacteristics to match the COFF spec.
621 // FIXME: This should be NumberOfRvaAndSizes to match the COFF spec.
623};
624
628};
629
630enum DataDirectoryIndex : unsigned {
646
649
650enum WindowsSubsystem : unsigned {
651 IMAGE_SUBSYSTEM_UNKNOWN = 0, ///< An unknown subsystem.
652 IMAGE_SUBSYSTEM_NATIVE = 1, ///< Device drivers and native Windows processes
653 IMAGE_SUBSYSTEM_WINDOWS_GUI = 2, ///< The Windows GUI subsystem.
654 IMAGE_SUBSYSTEM_WINDOWS_CUI = 3, ///< The Windows character subsystem.
655 IMAGE_SUBSYSTEM_OS2_CUI = 5, ///< The OS/2 character subsystem.
656 IMAGE_SUBSYSTEM_POSIX_CUI = 7, ///< The POSIX character subsystem.
657 IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8, ///< Native Windows 9x driver.
658 IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9, ///< Windows CE.
659 IMAGE_SUBSYSTEM_EFI_APPLICATION = 10, ///< An EFI application.
660 IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, ///< An EFI driver with boot
661 /// services.
662 IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, ///< An EFI driver with run-time
663 /// services.
664 IMAGE_SUBSYSTEM_EFI_ROM = 13, ///< An EFI ROM image.
665 IMAGE_SUBSYSTEM_XBOX = 14, ///< XBOX.
666 IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16 ///< A BCD application.
668
669enum DLLCharacteristics : unsigned {
670 /// ASLR with 64 bit address space.
672 /// DLL can be relocated at load time.
674 /// Code integrity checks are enforced.
676 ///< Image is NX compatible.
678 /// Isolation aware, but do not isolate the image.
680 /// Does not use structured exception handling (SEH). No SEH handler may be
681 /// called in this image.
683 /// Do not bind the image.
685 ///< Image should execute in an AppContainer.
687 ///< A WDM driver.
689 ///< Image supports Control Flow Guard.
691 /// Terminal Server aware.
694
696 /// Image is CET compatible
698 /// Image is CET compatible in strict mode
700 /// Image is CET compatible in such a way that context IP validation is
701 /// relaxed
703 0x0004,
704 /// Image is CET compatible in such a way that the use of
705 /// dynamic APIs is restricted to processes only
707 /// Reserved for future use. Not used by MSVC link.exe
709 /// Reserved for future use. Not used by MSVC link.exe
711 /// Image is CFI compatible.
713 /// Image is hotpatch compatible.
715};
716
717enum DebugType : unsigned {
736};
737
738enum BaseRelocationType : unsigned {
750
751enum ImportType : unsigned {
754 IMPORT_CONST = 2
756
757enum ImportNameType : unsigned {
758 /// Import is by ordinal. This indicates that the value in the Ordinal/Hint
759 /// field of the import header is the import's ordinal. If this constant is
760 /// not specified, then the Ordinal/Hint field should always be interpreted
761 /// as the import's hint.
763 /// The import name is identical to the public symbol name
765 /// The import name is the public symbol name, but skipping the leading ?,
766 /// @, or optionally _.
768 /// The import name is the public symbol name, but skipping the leading ?,
769 /// @, or optionally _, and truncating at the first @.
771 /// The import name is specified as a separate string in the import library
772 /// object file.
775
776enum class GuardFlags : uint32_t {
777 /// Module performs control flow integrity checks using system-supplied
778 /// support.
779 CF_INSTRUMENTED = 0x100,
780 /// Module performs control flow and write integrity checks.
781 CFW_INSTRUMENTED = 0x200,
782 /// Module contains valid control flow target metadata.
784 /// Module does not make use of the /GS security cookie.
786 /// Module supports read only delay load IAT.
787 PROTECT_DELAYLOAD_IAT = 0x1000,
788 /// Delayload import table in its own .didat section (with nothing else in it)
789 /// that can be freely reprotected.
791 /// Module contains suppressed export information. This also infers that the
792 /// address taken IAT table is also present in the load config.
794 /// Module enables suppression of exports.
796 /// Module contains longjmp target information.
798 /// Module contains EH continuation target information.
800 /// Mask for the subfield that contains the stride of Control Flow Guard
801 /// function table entries (that is, the additional count of bytes per table
802 /// entry).
803 CF_FUNCTION_TABLE_SIZE_MASK = 0xF0000000,
819};
820
822 uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
823 uint16_t Sig2; ///< Must be 0xFFFF.
830
831 ImportType getType() const { return static_cast<ImportType>(TypeInfo & 0x3); }
832
834 return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
835 }
836};
837
842
843// These flags show up in the @feat.00 symbol. They appear to be some kind of
844// compiler features bitfield read by link.exe.
846 // Object is compatible with /safeseh.
847 SafeSEH = 0x1,
848 // Object was compiled with /GS.
849 GuardStack = 0x100,
850 // Object was compiled with /sdl.
851 SDL = 0x200,
852 // Object was compiled with /guard:cf.
853 GuardCF = 0x800,
854 // Object was compiled with /guard:ehcont.
855 GuardEHCont = 0x4000,
856 // Object was compiled with /kernel.
857 Kernel = 0x40000000,
858};
859
862 Entry = 1,
863 Exit = 4,
864};
865
866inline bool isReservedSectionNumber(int32_t SectionNumber) {
867 return SectionNumber <= 0;
868}
869
870/// Encode section name based on string table offset.
871/// The size of Out must be at least COFF::NameSize.
873
874} // End namespace COFF.
875} // End namespace llvm.
876
877#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
COFF::MachineTypes Machine
Definition: COFFYAML.cpp:390
#define LLVM_ABI
Definition: Compiler.h:213
std::pair< llvm::MachO::Target, std::string > UUID
static const char ClGlObjMagic[]
Definition: COFF.h:43
DLLCharacteristics
Definition: COFF.h:669
@ IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE
Terminal Server aware.
Definition: COFF.h:692
@ IMAGE_DLL_CHARACTERISTICS_GUARD_CF
Definition: COFF.h:690
@ IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
Isolation aware, but do not isolate the image.
Definition: COFF.h:679
@ IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
Definition: COFF.h:677
@ IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER
Image supports Control Flow Guard.
Definition: COFF.h:688
@ IMAGE_DLL_CHARACTERISTICS_NO_BIND
Do not bind the image.
Definition: COFF.h:684
@ IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
Code integrity checks are enforced.
Definition: COFF.h:675
@ IMAGE_DLL_CHARACTERISTICS_APPCONTAINER
A WDM driver.
Definition: COFF.h:686
@ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
DLL can be relocated at load time.
Definition: COFF.h:673
@ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
ASLR with 64 bit address space.
Definition: COFF.h:671
@ IMAGE_DLL_CHARACTERISTICS_NO_SEH
Does not use structured exception handling (SEH).
Definition: COFF.h:682
AuxSymbolType
Definition: COFF.h:283
@ IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF
Definition: COFF.h:283
BaseRelocationType
Definition: COFF.h:738
@ IMAGE_REL_BASED_MIPS_JMPADDR16
Definition: COFF.h:747
@ IMAGE_REL_BASED_ARM_MOV32T
Definition: COFF.h:746
@ IMAGE_REL_BASED_ABSOLUTE
Definition: COFF.h:739
@ IMAGE_REL_BASED_MIPS_JMPADDR
Definition: COFF.h:744
@ IMAGE_REL_BASED_DIR64
Definition: COFF.h:748
@ IMAGE_REL_BASED_HIGH
Definition: COFF.h:740
@ IMAGE_REL_BASED_HIGHLOW
Definition: COFF.h:742
@ IMAGE_REL_BASED_HIGHADJ
Definition: COFF.h:743
@ IMAGE_REL_BASED_ARM_MOV32A
Definition: COFF.h:745
@ IMAGE_REL_BASED_LOW
Definition: COFF.h:741
RelocationTypesMips
Definition: COFF.h:421
@ IMAGE_REL_MIPS_PAIR
Definition: COFF.h:436
@ IMAGE_REL_MIPS_JMPADDR
Definition: COFF.h:425
@ IMAGE_REL_MIPS_REFHI
Definition: COFF.h:426
@ IMAGE_REL_MIPS_REFLO
Definition: COFF.h:427
@ IMAGE_REL_MIPS_LITERAL
Definition: COFF.h:429
@ IMAGE_REL_MIPS_REFHALF
Definition: COFF.h:423
@ IMAGE_REL_MIPS_SECRELHI
Definition: COFF.h:433
@ IMAGE_REL_MIPS_JMPADDR16
Definition: COFF.h:434
@ IMAGE_REL_MIPS_ABSOLUTE
Definition: COFF.h:422
@ IMAGE_REL_MIPS_SECRELLO
Definition: COFF.h:432
@ IMAGE_REL_MIPS_GPREL
Definition: COFF.h:428
@ IMAGE_REL_MIPS_REFWORDNB
Definition: COFF.h:435
@ IMAGE_REL_MIPS_REFWORD
Definition: COFF.h:424
@ IMAGE_REL_MIPS_SECREL
Definition: COFF.h:431
@ IMAGE_REL_MIPS_SECTION
Definition: COFF.h:430
DynamicRelocationType
Definition: COFF.h:439
@ IMAGE_DYNAMIC_RELOCATION_ARM64X
Definition: COFF.h:445
@ IMAGE_DYNAMIC_RELOCATION_GUARD_SWITCHTABLE_BRANCH
Definition: COFF.h:444
@ IMAGE_DYNAMIC_RELOCATION_GUARD_RF_EPILOGUE
Definition: COFF.h:441
@ IMAGE_DYNAMIC_RELOCATION_GUARD_INDIR_CONTROL_TRANSFER
Definition: COFF.h:443
@ IMAGE_DYNAMIC_RELOCATION_GUARD_IMPORT_CONTROL_TRANSFER
Definition: COFF.h:442
@ IMAGE_DYNAMIC_RELOCATION_GUARD_RF_PROLOGUE
Definition: COFF.h:440
MachineTypes
Definition: COFF.h:93
@ IMAGE_FILE_MACHINE_WCEMIPSV2
Definition: COFF.h:122
@ IMAGE_FILE_MACHINE_ARM64
Definition: COFF.h:101
@ IMAGE_FILE_MACHINE_IA64
Definition: COFF.h:106
@ IMAGE_FILE_MACHINE_POWERPCFP
Definition: COFF.h:112
@ IMAGE_FILE_MACHINE_POWERPC
Definition: COFF.h:111
@ IMAGE_FILE_MACHINE_SH5
Definition: COFF.h:120
@ IMAGE_FILE_MACHINE_UNKNOWN
Definition: COFF.h:96
@ IMAGE_FILE_MACHINE_MIPS16
Definition: COFF.h:108
@ IMAGE_FILE_MACHINE_THUMB
Definition: COFF.h:121
@ IMAGE_FILE_MACHINE_AMD64
Definition: COFF.h:98
@ IMAGE_FILE_MACHINE_ARM64EC
Definition: COFF.h:102
@ IMAGE_FILE_MACHINE_MIPSFPU16
Definition: COFF.h:110
@ IMAGE_FILE_MACHINE_AM33
Definition: COFF.h:97
@ IMAGE_FILE_MACHINE_R4000
Definition: COFF.h:113
@ IMAGE_FILE_MACHINE_M32R
Definition: COFF.h:107
@ IMAGE_FILE_MACHINE_MIPSFPU
Definition: COFF.h:109
@ IMAGE_FILE_MACHINE_RISCV64
Definition: COFF.h:115
@ IMAGE_FILE_MACHINE_RISCV32
Definition: COFF.h:114
@ IMAGE_FILE_MACHINE_SH3DSP
Definition: COFF.h:118
@ IMAGE_FILE_MACHINE_I386
Definition: COFF.h:105
@ MT_Invalid
Definition: COFF.h:94
@ IMAGE_FILE_MACHINE_RISCV128
Definition: COFF.h:116
@ IMAGE_FILE_MACHINE_ARM64X
Definition: COFF.h:103
@ IMAGE_FILE_MACHINE_SH4
Definition: COFF.h:119
@ IMAGE_FILE_MACHINE_EBC
Definition: COFF.h:104
@ IMAGE_FILE_MACHINE_ARM
Definition: COFF.h:99
@ IMAGE_FILE_MACHINE_ARMNT
Definition: COFF.h:100
@ IMAGE_FILE_MACHINE_SH3
Definition: COFF.h:117
SectionCharacteristics
Definition: COFF.h:298
@ IMAGE_SCN_ALIGN_64BYTES
Definition: COFF.h:321
@ IMAGE_SCN_ALIGN_128BYTES
Definition: COFF.h:322
@ IMAGE_SCN_MEM_NOT_PAGED
Definition: COFF.h:333
@ IMAGE_SCN_LNK_OTHER
Definition: COFF.h:306
@ IMAGE_SCN_MEM_SHARED
Definition: COFF.h:334
@ IMAGE_SCN_ALIGN_256BYTES
Definition: COFF.h:323
@ IMAGE_SCN_GPREL
Definition: COFF.h:310
@ IMAGE_SCN_ALIGN_1024BYTES
Definition: COFF.h:325
@ IMAGE_SCN_ALIGN_1BYTES
Definition: COFF.h:315
@ IMAGE_SCN_LNK_REMOVE
Definition: COFF.h:308
@ IMAGE_SCN_CNT_CODE
Definition: COFF.h:303
@ IMAGE_SCN_MEM_NOT_CACHED
Definition: COFF.h:332
@ IMAGE_SCN_MEM_READ
Definition: COFF.h:336
@ IMAGE_SCN_MEM_EXECUTE
Definition: COFF.h:335
@ IMAGE_SCN_ALIGN_512BYTES
Definition: COFF.h:324
@ IMAGE_SCN_CNT_UNINITIALIZED_DATA
Definition: COFF.h:305
@ IMAGE_SCN_MEM_DISCARDABLE
Definition: COFF.h:331
@ IMAGE_SCN_LNK_INFO
Definition: COFF.h:307
@ IMAGE_SCN_ALIGN_4096BYTES
Definition: COFF.h:327
@ IMAGE_SCN_MEM_16BIT
Definition: COFF.h:312
@ IMAGE_SCN_CNT_INITIALIZED_DATA
Definition: COFF.h:304
@ IMAGE_SCN_ALIGN_MASK
Definition: COFF.h:329
@ IMAGE_SCN_ALIGN_8192BYTES
Definition: COFF.h:328
@ IMAGE_SCN_MEM_PRELOAD
Definition: COFF.h:314
@ IMAGE_SCN_LNK_NRELOC_OVFL
Definition: COFF.h:330
@ IMAGE_SCN_ALIGN_16BYTES
Definition: COFF.h:319
@ IMAGE_SCN_TYPE_NO_PAD
Definition: COFF.h:302
@ IMAGE_SCN_MEM_PURGEABLE
Definition: COFF.h:311
@ IMAGE_SCN_LNK_COMDAT
Definition: COFF.h:309
@ IMAGE_SCN_ALIGN_8BYTES
Definition: COFF.h:318
@ IMAGE_SCN_ALIGN_4BYTES
Definition: COFF.h:317
@ IMAGE_SCN_ALIGN_32BYTES
Definition: COFF.h:320
@ IMAGE_SCN_ALIGN_2BYTES
Definition: COFF.h:316
@ SC_Invalid
Definition: COFF.h:299
@ IMAGE_SCN_ALIGN_2048BYTES
Definition: COFF.h:326
@ IMAGE_SCN_MEM_WRITE
Definition: COFF.h:337
@ IMAGE_SCN_MEM_LOCKED
Definition: COFF.h:313
@ IMAGE_SCN_TYPE_NOLOAD
Definition: COFF.h:301
bool isAnyArm64(T Machine)
Definition: COFF.h:130
ImportType
Definition: COFF.h:751
@ IMPORT_CONST
Definition: COFF.h:754
@ IMPORT_CODE
Definition: COFF.h:752
@ IMPORT_DATA
Definition: COFF.h:753
DebugType
Definition: COFF.h:717
@ IMAGE_DEBUG_TYPE_OMAP_FROM_SRC
Definition: COFF.h:726
@ IMAGE_DEBUG_TYPE_FIXUP
Definition: COFF.h:724
@ IMAGE_DEBUG_TYPE_REPRO
Definition: COFF.h:734
@ IMAGE_DEBUG_TYPE_ILTCG
Definition: COFF.h:732
@ IMAGE_DEBUG_TYPE_BORLAND
Definition: COFF.h:727
@ IMAGE_DEBUG_TYPE_COFF
Definition: COFF.h:719
@ IMAGE_DEBUG_TYPE_POGO
Definition: COFF.h:731
@ IMAGE_DEBUG_TYPE_VC_FEATURE
Definition: COFF.h:730
@ IMAGE_DEBUG_TYPE_CODEVIEW
Definition: COFF.h:720
@ IMAGE_DEBUG_TYPE_OMAP_TO_SRC
Definition: COFF.h:725
@ IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS
Definition: COFF.h:735
@ IMAGE_DEBUG_TYPE_MPX
Definition: COFF.h:733
@ IMAGE_DEBUG_TYPE_UNKNOWN
Definition: COFF.h:718
@ IMAGE_DEBUG_TYPE_FPO
Definition: COFF.h:721
@ IMAGE_DEBUG_TYPE_MISC
Definition: COFF.h:722
@ IMAGE_DEBUG_TYPE_EXCEPTION
Definition: COFF.h:723
@ IMAGE_DEBUG_TYPE_CLSID
Definition: COFF.h:729
@ IMAGE_DEBUG_TYPE_RESERVED10
Definition: COFF.h:728
RelocationTypesARM64
Definition: COFF.h:400
@ IMAGE_REL_ARM64_SECREL
Definition: COFF.h:409
@ IMAGE_REL_ARM64_BRANCH19
Definition: COFF.h:416
@ IMAGE_REL_ARM64_REL32
Definition: COFF.h:418
@ IMAGE_REL_ARM64_TOKEN
Definition: COFF.h:413
@ IMAGE_REL_ARM64_SECREL_LOW12A
Definition: COFF.h:410
@ IMAGE_REL_ARM64_ADDR32
Definition: COFF.h:402
@ IMAGE_REL_ARM64_SECTION
Definition: COFF.h:414
@ IMAGE_REL_ARM64_SECREL_HIGH12A
Definition: COFF.h:411
@ IMAGE_REL_ARM64_ABSOLUTE
Definition: COFF.h:401
@ IMAGE_REL_ARM64_PAGEOFFSET_12A
Definition: COFF.h:407
@ IMAGE_REL_ARM64_BRANCH14
Definition: COFF.h:417
@ IMAGE_REL_ARM64_BRANCH26
Definition: COFF.h:404
@ IMAGE_REL_ARM64_PAGEOFFSET_12L
Definition: COFF.h:408
@ IMAGE_REL_ARM64_SECREL_LOW12L
Definition: COFF.h:412
@ IMAGE_REL_ARM64_ADDR32NB
Definition: COFF.h:403
@ IMAGE_REL_ARM64_PAGEBASE_REL21
Definition: COFF.h:405
@ IMAGE_REL_ARM64_REL21
Definition: COFF.h:406
@ IMAGE_REL_ARM64_ADDR64
Definition: COFF.h:415
@ NameSize
Definition: COFF.h:58
@ Header16Size
Definition: COFF.h:56
@ Symbol16Size
Definition: COFF.h:59
@ Header32Size
Definition: COFF.h:57
@ SectionSize
Definition: COFF.h:61
@ Symbol32Size
Definition: COFF.h:60
@ RelocationSize
Definition: COFF.h:62
GuardFlags
Definition: COFF.h:776
@ PROTECT_DELAYLOAD_IAT
Module supports read only delay load IAT.
@ DELAYLOAD_IAT_IN_ITS_OWN_SECTION
Delayload import table in its own .didat section (with nothing else in it) that can be freely reprote...
@ CF_EXPORT_SUPPRESSION_INFO_PRESENT
Module contains suppressed export information.
@ CF_INSTRUMENTED
Module performs control flow integrity checks using system-supplied support.
@ EH_CONTINUATION_TABLE_PRESENT
Module contains EH continuation target information.
@ CF_FUNCTION_TABLE_SIZE_MASK
Mask for the subfield that contains the stride of Control Flow Guard function table entries (that is,...
@ CF_LONGJUMP_TABLE_PRESENT
Module contains longjmp target information.
@ CF_FUNCTION_TABLE_PRESENT
Module contains valid control flow target metadata.
@ SECURITY_COOKIE_UNUSED
Module does not make use of the /GS security cookie.
@ CFW_INSTRUMENTED
Module performs control flow and write integrity checks.
@ CF_ENABLE_EXPORT_SUPPRESSION
Module enables suppression of exports.
RelocationTypeAMD64
Definition: COFF.h:360
@ IMAGE_REL_AMD64_REL32
Definition: COFF.h:365
@ IMAGE_REL_AMD64_TOKEN
Definition: COFF.h:374
@ IMAGE_REL_AMD64_REL32_5
Definition: COFF.h:370
@ IMAGE_REL_AMD64_ADDR64
Definition: COFF.h:362
@ IMAGE_REL_AMD64_REL32_3
Definition: COFF.h:368
@ IMAGE_REL_AMD64_ADDR32NB
Definition: COFF.h:364
@ IMAGE_REL_AMD64_SREL32
Definition: COFF.h:375
@ IMAGE_REL_AMD64_ADDR32
Definition: COFF.h:363
@ IMAGE_REL_AMD64_ABSOLUTE
Definition: COFF.h:361
@ IMAGE_REL_AMD64_PAIR
Definition: COFF.h:376
@ IMAGE_REL_AMD64_SECTION
Definition: COFF.h:371
@ IMAGE_REL_AMD64_REL32_2
Definition: COFF.h:367
@ IMAGE_REL_AMD64_REL32_1
Definition: COFF.h:366
@ IMAGE_REL_AMD64_SECREL
Definition: COFF.h:372
@ IMAGE_REL_AMD64_SECREL7
Definition: COFF.h:373
@ IMAGE_REL_AMD64_REL32_4
Definition: COFF.h:369
@ IMAGE_REL_AMD64_SSPAN32
Definition: COFF.h:377
DataDirectoryIndex
Definition: COFF.h:630
@ ARCHITECTURE
Definition: COFF.h:638
@ IAT
Definition: COFF.h:643
@ CERTIFICATE_TABLE
Definition: COFF.h:635
@ TLS_TABLE
Definition: COFF.h:640
@ EXCEPTION_TABLE
Definition: COFF.h:634
@ GLOBAL_PTR
Definition: COFF.h:639
@ EXPORT_TABLE
Definition: COFF.h:631
@ LOAD_CONFIG_TABLE
Definition: COFF.h:641
@ IMPORT_TABLE
Definition: COFF.h:632
@ DELAY_IMPORT_DESCRIPTOR
Definition: COFF.h:644
@ CLR_RUNTIME_HEADER
Definition: COFF.h:645
@ RESOURCE_TABLE
Definition: COFF.h:633
@ DEBUG_DIRECTORY
Definition: COFF.h:637
@ BASE_RELOCATION_TABLE
Definition: COFF.h:636
@ NUM_DATA_DIRECTORIES
Definition: COFF.h:647
@ BOUND_IMPORT
Definition: COFF.h:642
SymbolStorageClass
Storage class tells where and what the symbol represents.
Definition: COFF.h:218
@ IMAGE_SYM_CLASS_MEMBER_OF_UNION
Member of union.
Definition: COFF.h:233
@ IMAGE_SYM_CLASS_AUTOMATIC
Stack variable.
Definition: COFF.h:223
@ SSC_Invalid
Definition: COFF.h:219
@ IMAGE_SYM_CLASS_BIT_FIELD
Bit field.
Definition: COFF.h:240
@ IMAGE_SYM_CLASS_REGISTER
Register variable.
Definition: COFF.h:226
@ IMAGE_SYM_CLASS_SECTION
Line number, reformatted as symbol.
Definition: COFF.h:248
@ IMAGE_SYM_CLASS_REGISTER_PARAM
Register parameter.
Definition: COFF.h:239
@ IMAGE_SYM_CLASS_END_OF_STRUCT
End of structure.
Definition: COFF.h:245
@ IMAGE_SYM_CLASS_MEMBER_OF_ENUM
Member of enumeration.
Definition: COFF.h:238
@ IMAGE_SYM_CLASS_EXTERNAL_DEF
External definition.
Definition: COFF.h:227
@ IMAGE_SYM_CLASS_TYPE_DEFINITION
Type definition.
Definition: COFF.h:235
@ IMAGE_SYM_CLASS_MEMBER_OF_STRUCT
Member of structure.
Definition: COFF.h:230
@ IMAGE_SYM_CLASS_BLOCK
".bb" or ".eb" - beginning or end of block
Definition: COFF.h:242
@ IMAGE_SYM_CLASS_ENUM_TAG
Enumeration tag.
Definition: COFF.h:237
@ IMAGE_SYM_CLASS_UNION_TAG
Union tag.
Definition: COFF.h:234
@ IMAGE_SYM_CLASS_FUNCTION
".bf" or ".ef" - beginning or end of function
Definition: COFF.h:244
@ IMAGE_SYM_CLASS_STRUCT_TAG
Structure tag.
Definition: COFF.h:232
@ IMAGE_SYM_CLASS_EXTERNAL
External symbol.
Definition: COFF.h:224
@ IMAGE_SYM_CLASS_LABEL
Label.
Definition: COFF.h:228
@ IMAGE_SYM_CLASS_ARGUMENT
Function argument.
Definition: COFF.h:231
@ IMAGE_SYM_CLASS_END_OF_FUNCTION
Physical end of function.
Definition: COFF.h:221
@ IMAGE_SYM_CLASS_FILE
File name.
Definition: COFF.h:246
@ IMAGE_SYM_CLASS_UNDEFINED_STATIC
Undefined static.
Definition: COFF.h:236
@ IMAGE_SYM_CLASS_CLR_TOKEN
External symbol in dmert public lib.
Definition: COFF.h:251
@ IMAGE_SYM_CLASS_NULL
No symbol.
Definition: COFF.h:222
@ IMAGE_SYM_CLASS_UNDEFINED_LABEL
Undefined label.
Definition: COFF.h:229
@ IMAGE_SYM_CLASS_WEAK_EXTERNAL
Duplicate tag.
Definition: COFF.h:249
@ IMAGE_SYM_CLASS_STATIC
Static.
Definition: COFF.h:225
LLVM_ABI bool encodeSectionName(char *Out, uint64_t Offset)
Encode section name based on string table offset.
Definition: COFF.cpp:39
Arm64XFixupType
Definition: COFF.h:448
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_VALUE
Definition: COFF.h:450
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_DELTA
Definition: COFF.h:451
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_ZEROFILL
Definition: COFF.h:449
ExtendedDLLCharacteristics
Definition: COFF.h:695
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE
Image is CET compatible in strict mode.
Definition: COFF.h:699
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1
Reserved for future use. Not used by MSVC link.exe.
Definition: COFF.h:708
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2
Reserved for future use. Not used by MSVC link.exe.
Definition: COFF.h:710
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE
Image is CET compatible in such a way that context IP validation is relaxed.
Definition: COFF.h:702
@ IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT
Image is CFI compatible.
Definition: COFF.h:712
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
Image is CET compatible.
Definition: COFF.h:697
@ IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE
Image is hotpatch compatible.
Definition: COFF.h:714
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY
Image is CET compatible in such a way that the use of dynamic APIs is restricted to processes only.
Definition: COFF.h:706
ResourceTypeID
Definition: COFF.h:178
@ RID_Menu
Definition: COFF.h:182
@ RID_AniCursor
Definition: COFF.h:196
@ RID_MessageTable
Definition: COFF.h:189
@ RID_RCData
Definition: COFF.h:188
@ RID_Accelerator
Definition: COFF.h:187
@ RID_FontDir
Definition: COFF.h:185
@ RID_VXD
Definition: COFF.h:195
@ RID_Bitmap
Definition: COFF.h:180
@ RID_HTML
Definition: COFF.h:198
@ RID_Manifest
Definition: COFF.h:199
@ RID_Version
Definition: COFF.h:192
@ RID_AniIcon
Definition: COFF.h:197
@ RID_DLGInclude
Definition: COFF.h:193
@ RID_Group_Cursor
Definition: COFF.h:190
@ RID_Group_Icon
Definition: COFF.h:191
@ RID_Icon
Definition: COFF.h:181
@ RID_Font
Definition: COFF.h:186
@ RID_Cursor
Definition: COFF.h:179
@ RID_Dialog
Definition: COFF.h:183
@ RID_PlugPlay
Definition: COFF.h:194
@ RID_String
Definition: COFF.h:184
WindowsSubsystem
Definition: COFF.h:650
@ IMAGE_SUBSYSTEM_EFI_APPLICATION
An EFI application.
Definition: COFF.h:659
@ IMAGE_SUBSYSTEM_WINDOWS_CUI
The Windows character subsystem.
Definition: COFF.h:654
@ IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
Windows CE.
Definition: COFF.h:658
@ IMAGE_SUBSYSTEM_XBOX
XBOX.
Definition: COFF.h:665
@ IMAGE_SUBSYSTEM_UNKNOWN
An unknown subsystem.
Definition: COFF.h:651
@ IMAGE_SUBSYSTEM_OS2_CUI
The OS/2 character subsystem.
Definition: COFF.h:655
@ IMAGE_SUBSYSTEM_NATIVE_WINDOWS
Native Windows 9x driver.
Definition: COFF.h:657
@ IMAGE_SUBSYSTEM_EFI_ROM
An EFI ROM image.
Definition: COFF.h:664
@ IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
An EFI driver with run-time services.
Definition: COFF.h:662
@ IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
An EFI driver with boot services.
Definition: COFF.h:660
@ IMAGE_SUBSYSTEM_POSIX_CUI
The POSIX character subsystem.
Definition: COFF.h:656
@ IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION
A BCD application.
Definition: COFF.h:666
@ IMAGE_SUBSYSTEM_WINDOWS_GUI
The Windows GUI subsystem.
Definition: COFF.h:653
@ IMAGE_SUBSYSTEM_NATIVE
Device drivers and native Windows processes.
Definition: COFF.h:652
static const char WinResMagic[]
Definition: COFF.h:49
COMDATType
Definition: COFF.h:454
@ IMAGE_COMDAT_SELECT_NODUPLICATES
Definition: COFF.h:455
@ IMAGE_COMDAT_SELECT_LARGEST
Definition: COFF.h:460
@ IMAGE_COMDAT_SELECT_NEWEST
Definition: COFF.h:461
@ IMAGE_COMDAT_SELECT_SAME_SIZE
Definition: COFF.h:457
@ IMAGE_COMDAT_SELECT_ASSOCIATIVE
Definition: COFF.h:459
@ IMAGE_COMDAT_SELECT_EXACT_MATCH
Definition: COFF.h:458
@ IMAGE_COMDAT_SELECT_ANY
Definition: COFF.h:456
WeakExternalCharacteristics
Definition: COFF.h:487
@ IMAGE_WEAK_EXTERN_SEARCH_ALIAS
Definition: COFF.h:490
@ IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY
Definition: COFF.h:491
@ IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY
Definition: COFF.h:488
@ IMAGE_WEAK_EXTERN_SEARCH_LIBRARY
Definition: COFF.h:489
CodeViewIdentifiers
Definition: COFF.h:838
@ DEBUG_HASHES_SECTION_MAGIC
Definition: COFF.h:840
@ DEBUG_SECTION_MAGIC
Definition: COFF.h:839
bool is64Bit(T Machine)
Definition: COFF.h:134
RelocationTypesARM
Definition: COFF.h:380
@ IMAGE_REL_ARM_MOV32A
Definition: COFF.h:392
@ IMAGE_REL_ARM_BRANCH20T
Definition: COFF.h:394
@ IMAGE_REL_ARM_BRANCH24
Definition: COFF.h:384
@ IMAGE_REL_ARM_ADDR32NB
Definition: COFF.h:383
@ IMAGE_REL_ARM_BRANCH11
Definition: COFF.h:385
@ IMAGE_REL_ARM_BLX24
Definition: COFF.h:387
@ IMAGE_REL_ARM_ADDR32
Definition: COFF.h:382
@ IMAGE_REL_ARM_MOV32T
Definition: COFF.h:393
@ IMAGE_REL_ARM_BRANCH24T
Definition: COFF.h:395
@ IMAGE_REL_ARM_PAIR
Definition: COFF.h:397
@ IMAGE_REL_ARM_ABSOLUTE
Definition: COFF.h:381
@ IMAGE_REL_ARM_REL32
Definition: COFF.h:389
@ IMAGE_REL_ARM_BLX23T
Definition: COFF.h:396
@ IMAGE_REL_ARM_SECREL
Definition: COFF.h:391
@ IMAGE_REL_ARM_SECTION
Definition: COFF.h:390
@ IMAGE_REL_ARM_BLX11
Definition: COFF.h:388
@ IMAGE_REL_ARM_TOKEN
Definition: COFF.h:386
bool isArm64EC(T Machine)
Definition: COFF.h:125
const int32_t MaxNumberOfSections16
Definition: COFF.h:33
ImportNameType
Definition: COFF.h:757
@ IMPORT_ORDINAL
Import is by ordinal.
Definition: COFF.h:762
@ IMPORT_NAME_EXPORTAS
The import name is specified as a separate string in the import library object file.
Definition: COFF.h:773
@ IMPORT_NAME
The import name is identical to the public symbol name.
Definition: COFF.h:764
@ IMPORT_NAME_UNDECORATE
The import name is the public symbol name, but skipping the leading ?, @, or optionally _,...
Definition: COFF.h:770
@ IMPORT_NAME_NOPREFIX
The import name is the public symbol name, but skipping the leading ?, @, or optionally _.
Definition: COFF.h:767
bool isReservedSectionNumber(int32_t SectionNumber)
Definition: COFF.h:866
RelocationTypeI386
Definition: COFF.h:346
@ IMAGE_REL_I386_TOKEN
Definition: COFF.h:355
@ IMAGE_REL_I386_SECTION
Definition: COFF.h:353
@ IMAGE_REL_I386_SECREL7
Definition: COFF.h:356
@ IMAGE_REL_I386_REL32
Definition: COFF.h:357
@ IMAGE_REL_I386_REL16
Definition: COFF.h:349
@ IMAGE_REL_I386_DIR16
Definition: COFF.h:348
@ IMAGE_REL_I386_SECREL
Definition: COFF.h:354
@ IMAGE_REL_I386_DIR32
Definition: COFF.h:350
@ IMAGE_REL_I386_ABSOLUTE
Definition: COFF.h:347
@ IMAGE_REL_I386_SEG12
Definition: COFF.h:352
@ IMAGE_REL_I386_DIR32NB
Definition: COFF.h:351
SymbolBaseType
Definition: COFF.h:254
@ IMAGE_SYM_TYPE_DOUBLE
An 8-byte floating-point number.
Definition: COFF.h:262
@ IMAGE_SYM_TYPE_DWORD
An unsigned 4-byte integer.
Definition: COFF.h:270
@ IMAGE_SYM_TYPE_STRUCT
A structure.
Definition: COFF.h:263
@ IMAGE_SYM_TYPE_SHORT
A 2-byte signed integer.
Definition: COFF.h:258
@ IMAGE_SYM_TYPE_UINT
An unsigned integer of natural size.
Definition: COFF.h:269
@ IMAGE_SYM_TYPE_NULL
No type information or unknown base type.
Definition: COFF.h:255
@ IMAGE_SYM_TYPE_CHAR
A character (signed byte).
Definition: COFF.h:257
@ IMAGE_SYM_TYPE_ENUM
An enumerated type.
Definition: COFF.h:265
@ IMAGE_SYM_TYPE_FLOAT
A 4-byte floating-point number.
Definition: COFF.h:261
@ IMAGE_SYM_TYPE_INT
A natural integer type on the target.
Definition: COFF.h:259
@ IMAGE_SYM_TYPE_LONG
A 4-byte signed integer.
Definition: COFF.h:260
@ IMAGE_SYM_TYPE_UNION
An union.
Definition: COFF.h:264
@ IMAGE_SYM_TYPE_MOE
A member of enumeration (a specific value).
Definition: COFF.h:266
@ IMAGE_SYM_TYPE_BYTE
A byte; unsigned 1-byte integer.
Definition: COFF.h:267
@ IMAGE_SYM_TYPE_WORD
A word; unsigned 2-byte integer.
Definition: COFF.h:268
@ IMAGE_SYM_TYPE_VOID
Used with void pointers and functions.
Definition: COFF.h:256
Arm64ECThunkType
Definition: COFF.h:860
@ GuestExit
Definition: COFF.h:861
@ Entry
Definition: COFF.h:862
@ Exit
Definition: COFF.h:863
static const char BigObjMagic[]
Definition: COFF.h:38
Characteristics
Definition: COFF.h:138
@ IMAGE_FILE_LINE_NUMS_STRIPPED
COFF line numbers have been stripped.
Definition: COFF.h:148
@ C_Invalid
Definition: COFF.h:139
@ IMAGE_FILE_DEBUG_STRIPPED
Debugging info has been removed.
Definition: COFF.h:162
@ IMAGE_FILE_DLL
The image file is a DLL.
Definition: COFF.h:170
@ IMAGE_FILE_AGGRESSIVE_WS_TRIM
Aggressively trim working set. This is deprecated and must be 0.
Definition: COFF.h:153
@ IMAGE_FILE_BYTES_REVERSED_LO
Little endian: the LSB precedes the MSB in memory.
Definition: COFF.h:158
@ IMAGE_FILE_UP_SYSTEM_ONLY
This file should only be run on a uniprocessor machine.
Definition: COFF.h:172
@ IMAGE_FILE_LARGE_ADDRESS_AWARE
Image can handle > 2GiB addresses.
Definition: COFF.h:155
@ IMAGE_FILE_BYTES_REVERSED_HI
Big endian: the MSB precedes the LSB in memory.
Definition: COFF.h:175
@ IMAGE_FILE_SYSTEM
The image file is a system file, not a user program.
Definition: COFF.h:168
@ IMAGE_FILE_32BIT_MACHINE
Machine is based on a 32bit word architecture.
Definition: COFF.h:160
@ IMAGE_FILE_LOCAL_SYMS_STRIPPED
COFF symbol table entries for local symbols have been removed.
Definition: COFF.h:151
@ IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
If the image is on removable media, fully load it and copy it to swap.
Definition: COFF.h:164
@ IMAGE_FILE_EXECUTABLE_IMAGE
The file is valid and can be run.
Definition: COFF.h:145
@ IMAGE_FILE_NET_RUN_FROM_SWAP
If the image is on network media, fully load it and copy it to swap.
Definition: COFF.h:166
@ IMAGE_FILE_RELOCS_STRIPPED
The file does not contain base relocations and must be loaded at its preferred base.
Definition: COFF.h:143
static const char PEMagic[]
Definition: COFF.h:36
Feat00Flags
Definition: COFF.h:845
@ SafeSEH
Definition: COFF.h:847
@ GuardEHCont
Definition: COFF.h:855
@ SDL
Definition: COFF.h:851
@ GuardStack
Definition: COFF.h:849
@ GuardCF
Definition: COFF.h:853
@ Kernel
Definition: COFF.h:857
SymbolSectionNumber
Definition: COFF.h:211
@ IMAGE_SYM_DEBUG
Definition: COFF.h:212
@ IMAGE_SYM_UNDEFINED
Definition: COFF.h:214
@ IMAGE_SYM_ABSOLUTE
Definition: COFF.h:213
SymbolComplexType
Definition: COFF.h:273
@ IMAGE_SYM_DTYPE_ARRAY
An array of base type.
Definition: COFF.h:277
@ IMAGE_SYM_DTYPE_NULL
No complex type; simple scalar variable.
Definition: COFF.h:274
@ IMAGE_SYM_DTYPE_POINTER
A pointer to base type.
Definition: COFF.h:275
@ IMAGE_SYM_DTYPE_FUNCTION
A function that returns a base type.
Definition: COFF.h:276
@ SCT_COMPLEX_TYPE_SHIFT
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
Definition: COFF.h:280
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:477
uint16_t Machine
Definition: COFF.h:81
uint32_t NumberOfSymbols
Definition: COFF.h:90
uint32_t unused4
Definition: COFF.h:87
uint32_t PointerToSymbolTable
Definition: COFF.h:89
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:78
uint32_t unused1
Definition: COFF.h:84
uint32_t unused3
Definition: COFF.h:86
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:79
uint32_t TimeDateStamp
Definition: COFF.h:82
uint16_t Version
Definition: COFF.h:80
uint32_t unused2
Definition: COFF.h:85
uint32_t NumberOfSections
Definition: COFF.h:88
The DOS compatible header at the front of all PEs.
Definition: COFF.h:566
uint16_t UsedBytesInTheLastPage
Definition: COFF.h:568
uint16_t Reserved[4]
Definition: COFF.h:581
uint16_t InitialRelativeCS
Definition: COFF.h:578
uint16_t NumberOfRelocationItems
Definition: COFF.h:570
uint16_t MinimumExtraParagraphs
Definition: COFF.h:572
uint16_t Reserved2[10]
Definition: COFF.h:584
uint16_t FileSizeInPages
Definition: COFF.h:569
uint16_t Checksum
Definition: COFF.h:576
uint16_t MaximumExtraParagraphs
Definition: COFF.h:573
uint16_t InitialRelativeSS
Definition: COFF.h:574
uint32_t AddressOfNewExeHeader
Definition: COFF.h:585
uint16_t InitialSP
Definition: COFF.h:575
uint16_t OEMinfo
Definition: COFF.h:583
uint16_t Magic
Definition: COFF.h:567
uint16_t InitialIP
Definition: COFF.h:577
uint16_t HeaderSizeInParagraphs
Definition: COFF.h:571
uint16_t OverlayNumber
Definition: COFF.h:580
uint16_t AddressOfRelocationTable
Definition: COFF.h:579
uint16_t OEMid
Definition: COFF.h:582
uint32_t RelativeVirtualAddress
Definition: COFF.h:626
The Import Directory Table.
Definition: COFF.h:521
ImportNameType getNameType() const
Definition: COFF.h:833
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:822
ImportType getType() const
Definition: COFF.h:831
uint16_t OrdinalHint
Definition: COFF.h:828
uint32_t TimeDateStamp
Definition: COFF.h:826
uint32_t SizeOfData
Definition: COFF.h:827
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:823
The PE32 Import Lookup Table.
Definition: COFF.h:537
uint32_t getHintNameRVA() const
Get the Hint/Name entry RVA. isOrdinal must be false.
Definition: COFF.h:556
void setHintNameRVA(uint32_t rva)
Set the Hint/Name entry RVA and set isOrdinal to false.
Definition: COFF.h:562
void setOrdinal(uint16_t o)
Set the ordinal value and set isOrdinal to true.
Definition: COFF.h:550
uint16_t getOrdinal() const
Get the ordinal value of this entry. isOrdinal must be true.
Definition: COFF.h:544
bool isOrdinal() const
Is this entry specified by ordinal, or name?
Definition: COFF.h:541
uint32_t SizeOfImage
Definition: COFF.h:610
uint32_t SizeOfCode
Definition: COFF.h:594
uint32_t AddressOfEntryPoint
Definition: COFF.h:597
uint32_t SizeOfUninitializedData
Definition: COFF.h:596
uint32_t SizeOfInitializedData
Definition: COFF.h:595
uint32_t FileAlignment
Definition: COFF.h:602
uint16_t Magic
Definition: COFF.h:591
uint64_t SizeOfStackCommit
Definition: COFF.h:617
uint32_t LoaderFlags
Definition: COFF.h:620
uint32_t CheckSum
Definition: COFF.h:612
uint8_t MajorLinkerVersion
Definition: COFF.h:592
uint64_t SizeOfHeapReserve
Definition: COFF.h:618
uint16_t MinorOperatingSystemVersion
Definition: COFF.h:604
uint64_t ImageBase
Definition: COFF.h:600
uint32_t Win32VersionValue
Definition: COFF.h:609
uint16_t MajorSubsystemVersion
Definition: COFF.h:607
uint16_t MinorImageVersion
Definition: COFF.h:606
uint16_t MajorOperatingSystemVersion
Definition: COFF.h:603
uint16_t DLLCharacteristics
Definition: COFF.h:615
uint64_t SizeOfStackReserve
Definition: COFF.h:616
uint16_t MinorSubsystemVersion
Definition: COFF.h:608
uint32_t SectionAlignment
Definition: COFF.h:601
uint16_t MajorImageVersion
Definition: COFF.h:605
uint32_t NumberOfRvaAndSize
Definition: COFF.h:622
uint8_t MinorLinkerVersion
Definition: COFF.h:593
uint16_t Subsystem
Definition: COFF.h:613
uint32_t SizeOfHeaders
Definition: COFF.h:611
uint64_t SizeOfHeapCommit
Definition: COFF.h:619
uint32_t BaseOfData
Definition: COFF.h:599
uint32_t BaseOfCode
Definition: COFF.h:598
uint16_t Machine
Definition: COFF.h:66
uint32_t TimeDateStamp
Definition: COFF.h:68
uint16_t SizeOfOptionalHeader
Definition: COFF.h:71
uint32_t NumberOfSymbols
Definition: COFF.h:70
int32_t NumberOfSections
Definition: COFF.h:67
uint16_t Characteristics
Definition: COFF.h:72
uint32_t PointerToSymbolTable
Definition: COFF.h:69
uint32_t VirtualAddress
Definition: COFF.h:341
uint32_t SymbolTableIndex
Definition: COFF.h:342
uint32_t VirtualSize
Definition: COFF.h:287
uint32_t PointerToRelocations
Definition: COFF.h:291
uint16_t NumberOfLineNumbers
Definition: COFF.h:294
uint32_t PointerToRawData
Definition: COFF.h:290
uint32_t SizeOfRawData
Definition: COFF.h:289
uint32_t Characteristics
Definition: COFF.h:295
uint16_t NumberOfRelocations
Definition: COFF.h:293
char Name[NameSize]
Definition: COFF.h:286
uint32_t VirtualAddress
Definition: COFF.h:288
uint32_t PointerToLineNumbers
Definition: COFF.h:292
uint8_t StorageClass
Definition: COFF.h:207
int32_t SectionNumber
Definition: COFF.h:205
uint8_t NumberOfAuxSymbols
Definition: COFF.h:208
uint16_t Type
Definition: COFF.h:206
uint32_t Value
Definition: COFF.h:204
char Name[NameSize]
Definition: COFF.h:203
AuxiliarybfAndefSymbol bfAndefSymbol
Definition: COFF.h:513
AuxiliaryFunctionDefinition FunctionDefinition
Definition: COFF.h:512
AuxiliarySectionDefinition SectionDefinition
Definition: COFF.h:515
AuxiliaryWeakExternal WeakExternal
Definition: COFF.h:514