23 #ifndef LLVM_SUPPORT_COFF_H
24 #define LLVM_SUPPORT_COFF_H
26 #include "llvm/Support/DataTypes.h"
34 static const char PEMagic[] = {
'P',
'E',
'\0',
'\0' };
226 SC_Invalid = 0xffffffff,
228 IMAGE_SCN_TYPE_NO_PAD = 0x00000008,
229 IMAGE_SCN_CNT_CODE = 0x00000020,
230 IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040,
231 IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080,
232 IMAGE_SCN_LNK_OTHER = 0x00000100,
233 IMAGE_SCN_LNK_INFO = 0x00000200,
234 IMAGE_SCN_LNK_REMOVE = 0x00000800,
235 IMAGE_SCN_LNK_COMDAT = 0x00001000,
236 IMAGE_SCN_GPREL = 0x00008000,
237 IMAGE_SCN_MEM_PURGEABLE = 0x00020000,
238 IMAGE_SCN_MEM_16BIT = 0x00020000,
239 IMAGE_SCN_MEM_LOCKED = 0x00040000,
240 IMAGE_SCN_MEM_PRELOAD = 0x00080000,
241 IMAGE_SCN_ALIGN_1BYTES = 0x00100000,
242 IMAGE_SCN_ALIGN_2BYTES = 0x00200000,
243 IMAGE_SCN_ALIGN_4BYTES = 0x00300000,
244 IMAGE_SCN_ALIGN_8BYTES = 0x00400000,
245 IMAGE_SCN_ALIGN_16BYTES = 0x00500000,
246 IMAGE_SCN_ALIGN_32BYTES = 0x00600000,
247 IMAGE_SCN_ALIGN_64BYTES = 0x00700000,
248 IMAGE_SCN_ALIGN_128BYTES = 0x00800000,
249 IMAGE_SCN_ALIGN_256BYTES = 0x00900000,
250 IMAGE_SCN_ALIGN_512BYTES = 0x00A00000,
251 IMAGE_SCN_ALIGN_1024BYTES = 0x00B00000,
252 IMAGE_SCN_ALIGN_2048BYTES = 0x00C00000,
253 IMAGE_SCN_ALIGN_4096BYTES = 0x00D00000,
254 IMAGE_SCN_ALIGN_8192BYTES = 0x00E00000,
255 IMAGE_SCN_LNK_NRELOC_OVFL = 0x01000000,
256 IMAGE_SCN_MEM_DISCARDABLE = 0x02000000,
257 IMAGE_SCN_MEM_NOT_CACHED = 0x04000000,
258 IMAGE_SCN_MEM_NOT_PAGED = 0x08000000,
259 IMAGE_SCN_MEM_SHARED = 0x10000000,
260 IMAGE_SCN_MEM_EXECUTE = 0x20000000,
261 IMAGE_SCN_MEM_READ = 0x40000000,
262 IMAGE_SCN_MEM_WRITE = 0x80000000
410 assert(
isOrdinal() &&
"ILT entry is not an ordinal!");
411 return data & 0xFFFF;
422 assert(!
isOrdinal() &&
"ILT entry is not a Hint/Name RVA!");
A byte; unsigned 1-byte integer.
The Windows character subsystem.
Image can handle > 2GiB addresses.
void setOrdinal(uint16_t o)
Set the ordinal value and set isOrdinal to true.
uint32_t ImportAddressTableRVA
Physical end of function.
Device drivers and native Windows processes.
uint16_t getOrdinal() const
Get the ordinal value of this entry. isOrdinal must be true.
Aggressively trim working set. This is deprecated and must be 0.
Isolation aware, but do not isolate the image.
AuxiliarySectionDefinition SectionDefinition
The Windows GUI subsystem.
".bf" or ".ef" - beginning or end of function
No complex type; simple scalar variable.
The import name is identical to the public symbol name.
bool isOrdinal() const
Is this entry specified by ordinal, or name?
External symbol in dmert public lib.
An unsigned integer of natural size.
A 4-byte floating-point number.
AuxiliaryWeakExternal WeakExternal
The OS/2 character subsytem.
uint16_t NumberOfRelocations
The PE32 Import Lookup Table.
uint8_t NumberOfAuxSymbols
Used with void pointers and functions.
Machine is based on a 32bit word architecture.
No type information or unknown base type.
uint32_t SymbolTableIndex
Line number, reformatted as symbol.
An 8-byte floating-point number.
uint32_t ImportLookupTableRVA
enum SectionCharacteristics LLVM_ENUM_INT_TYPE(uint32_t)
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
void setHintNameRVA(uint32_t rva)
Set the Hint/Name entry RVA and set isOrdinal to false.
A function that returns a base type.
If the image is on removable media, fully load it and copy it to swap.
uint16_t NumberOfLineNumbers
A word; unsigned 2-byte integer.
An unsigned 4-byte integer.
This file should only be run on a uniprocessor machine.
uint32_t PointerToRelocations
DLL can be relocated at load time.
If the image is on network media, fully load it and copy it to swap.
Debugging info has been removed.
uint32_t PointerToNextFunction
uint32_t PointerToRawData
uint32_t RelativeVirtualAddress
SymbolStorageClass
Storage class tells where and what the symbol represents.
".bb" or ".eb" - beginning or end of block
A character (signed byte).
The POSIX character subsystem.
The Import Directory Table.
Code integrity checks are enforced.
static const char PEMagic[]
uint32_t PointerToNextFunction
The image file is a system file, not a user program.
uint32_t PointerToLinenumber
uint16_t NumberOfRelocations
AuxiliaryFunctionDefinition FunctionDefinition
A member of enumeration (a specific value).
uint32_t PointerToLineNumbers
uint32_t getHintNameRVA() const
Get the Hint/Name entry RVA. isOrdinal must be false.
uint16_t NumberOfLinenumbers
WeakExternalCharacteristics
These are not documented in the spec, but are located in WinNT.h.
AuxiliarybfAndefSymbol bfAndefSymbol
The file is valid and can be run.
Native Windows 9x driver.
A natural integer type on the target.