Microsoft Portable Executable and Common Object File Format Specification

Visual C++ Business Unit
Microsoft Corporation

Revision 6.0 February 1999

Note   This document is provided to aid in the development of tools and applications for Microsoft Windows NTŪ but is not guaranteed to be a complete specification in all respects. Microsoft reserves the right to alter this document without notice.

Contents

1. General Concepts
2. Overview
3. File Headers
3.1. MS-DOS Stub (Image Only)
3.2. Signature (Image Only)
3.3. COFF File Header (Object & Image)
3.3.1. Machine Types
3.3.2. Characteristics
3.4. Optional Header (Usually Image Only)
3.4.1. Optional Header Standard Fields (Image Only)
3.4.2. Optional Header Windows NT-Specific Fields (Image Only)
3.4.3. Optional Header Data Directories (Image Only)
4. Section Table (Section Headers)
4.1. Section Flags
4.2. Grouped Sections
5. Other Contents of the File
5.1. Section Data
5.2. COFF Relocations (Object Only)
5.2.1. Type Indicators
5.3. COFF Line Numbers
5.4. COFF Symbol Table
5.4.1. Symbol Name Representation
5.4.2. Section Number Values
5.4.3. Type Representation
5.4.4. Storage Class5.5. Auxiliary Symbol Records
5.5.1. Auxiliary Format 1: Function Definitions
5.5.2. Auxiliary Format 2: .bf and .ef Symbols
5.5.3. Auxiliary Format 3: Weak Externals
5.5.4. Auxiliary Format 4: Files
5.5.5. Auxiliary Format 5: Section Definitions
5.5.6. COMDAT Sections (Object Only)
5.6. COFF String Table
5.7. The Attribute Certificate table (Image Only)
5.7.1. Certificate Data
5.8. Delay-Load Import Tables (Image Only)
5.8.1. The Delay-Load Directory Table
5.8.2. Attributes
5.8.3. Name
5.8.4. Module Handle
5.8.5. Delay Import Address Table (IAT)
5.8.6. Delay Import Name Table (INT)
5.8.7. Delay Bound Import Address Table (BIAT) and Time Stamp
5.8.8. Delay Unload Import Address Table (UIAT)
6. Special Sections
6.1. The .debug Section
6.1.1. Debug Directory (Image Only)
6.1.2. Debug Type
6.1.3. .debug$F (Object Only)
6.1.4. .debug$S (Object Only)
6.1.5. .debug$T (Object Only)
6.1.6. Linker Support for Microsoft CodeView Debug Information
6.2. The .drectve Section (Object Only)
6.3. The .edata Section (Image Only)
6.3.1. Export Directory Table
6.3.2. Export Address Table
6.3.3. Export Name Pointer Table
6.3.4. Export Ordinal Table
6.3.5. Export Name Table
6.4. The .idata Section
6.4.1. Import Directory Table
6.4.2. Import Lookup Table
6.4.3. Hint/Name Table
6.4.4. Import Address Table
6.5. The .pdata Section
6.6. The .reloc Section (Image Only)
6.6.1. Fixup Block
6.6.2. Fixup Types
6.7. The .tls Section
6.7.1. The TLS Directory
6.7.2. TLS Callback Functions
6.8. The .rsrc Section
6.8.1. Resource Directory Section
6.8.2. Resource Directory Entries
6.8.3. Resource Directory String
6.8.4. Resource Data Entry
6.8.5. Resource Example
7. Archive (Library) File Format
7.1. Archive File Signature
7.2. Archive Member Headers
7.3. First Linker Member
7.4. Second Linker Member
7.5. Longnames Member
8. Import Library Format
8.1. Import Header
8.2. Import Type
8.3. Import Name Type
Appendix: Example Object File
Appendix: Calculating Image Message Digests
Fields Not To Include In Digests