6.5.1 Fixup Block

Each fixup block starts with the following structure:

Offset Size Field Description
0 4 Page RVA The image base plus the page RVA is added to each offset to create the virtual address of where the fixup needs to be applied.
4 4 Block Size Total number of bytes in the fixup block, including the Page RVA and Block Size fields, as well as the Type/Offset fields that follow.

The Block Size field is then followed by any number of Type/Offset entries. Each entry is a word (2 bytes) and has the following structure:

Offset Size Field Description
0 4 bits Type Stored in high 4 bits of word. Value indicating which type of fixup is to be applied. These fixups are described in "Fixup Types."
0 12 bits Offset Stored in remaining 12 bits of word. Offset from starting address specified in the Page RVA field for the block. This offset specifies where the fixup is to be applied.

To apply a fixup, a delta is calculated as the difference between the preferred base address, and the base where the image is actually loaded. If the image is loaded at its preferred base, the delta would be zero, and thus the fixups would not have to be applied.