A fixup tells the linker to patch an address into the data. Each FIXUPP record (0x9C, 0x9D) applies to the LEDATA or LIDATA record just before it, and holds subrecords to the end of the record. There are two kinds, told apart by the top bit of the first byte.
Thread subrecord
Bit 7 is 0. A thread saves a frame or target so that the fixups after it can refer to it in one bit.
| Bits | Name | Meaning |
|---|---|---|
| 6 | D | 1 frame thread, 0 target thread |
| 5 | 0 | |
| 4–2 | Method | The frame or target method |
| 1–0 | Thred | Which of the four threads of that kind |
An index datum follows if the method needs one: target methods always, frame methods 0, 1 and 2.
Fixup subrecord
Bit 7 is 1. It has these fields, in order:
+0Locat: where and how to patch, high byte first2 bytes+2Fixdat: frame and target methods1 byte…Frame datum, an index, if F is 0 and the method needs one0 to 2 bytes…Target datum, an index, if T is 00 to 2 bytes…Target displacement, if P is 02 or 4 bytes
| Locat bits | Name | Meaning |
|---|---|---|
| 15 | 1: this is a fixup | |
| 14 | M | 1 segment-relative, 0 self-relative |
| 13–10 | Location | See Locations |
| 9–0 | Data record offset | Where in the LEDATA record before to patch |
| Fixdat bits | Name | Meaning |
|---|---|---|
| 7 | F | 1: the frame is thread number given in the Frame field |
| 6–4 | Frame | The frame method, or a thread number |
| 3 | T | 1: the target is a thread |
| 2 | P | 1: there is no target displacement |
| 1–0 | Targt | The target method, or a thread number |
Locations
| Value | Patches |
|---|---|
| 0 | The low byte of an offset |
| 1 | A 16-bit offset |
| 2 | A 16-bit segment base |
| 3 | A far pointer, 16:16 |
| 4 | The high byte of an offset |
| 5 | A 16-bit offset, resolved by the loader |
| 9 | A 32-bit offset |
| 11 | A far pointer, 16:32 |
| 13 | A 32-bit offset, resolved by the loader |
Frame and target methods
| Method | Frame | Target |
|---|---|---|
| 0 | A segment’s frame (datum: SEGDEF index) | A segment (datum: SEGDEF index), with a displacement |
| 1 | A group’s frame (datum: GRPDEF index) | A group (datum: GRPDEF index), with a displacement |
| 2 | An external’s frame (datum: external index) | An external (datum: external index), with a displacement |
| 3 | An absolute frame; not supported by linkers | A frame number; not supported |
| 4 | The segment of the data before | As 0 with no displacement |
| 5 | The target’s frame | As 1 with no displacement |
| 6 | As 2 with no displacement | |
| 7 | As 3 with no displacement |
When the target comes from a thread, the thread gives the low two bits of the method and P gives the 4’s bit.