Troubleshooting: Invalid Fix-ups in ROM Image (Windows Embedded CE 6.0)
1/5/2010
Description
When an invalid fix-up occurs in a build, the following error message is displayed.
ERROR: The ROMImage tool encountered an error processing Module nk.exe.
Instructions explaining how to correct the problem can be found in
section "Invalid Fix-ups in ROM Image" of the online documentation.
Use the following information to correct the problem:
Relocation Offset =0x778
Relocation Page =0x33000
Opcode =0x80a4718c
Opcode Address =0x8c5b3778
Note
The hexadecimal values vary depending on the location of the invalid fix-up. These values are examples.
Resolution
The following table shows the information required to correct the invalid fix-up.
Code location | Description |
---|---|
Relocation offset |
Relative offset from the page of the opcode where the illegal fix-up occurs. |
Relocation page |
Relative page from the preferred load address in the executable (.exe) or dynamic link library (.dll) of the opcode where the illegal fix-up occurs. To calculate the relative offset of the opcode from the preferred load address of the .exe or .dll, add the value specified for relocation offset to the value specified for relocation page. Using the numbers from the previous message example, the opcode where the illegal fix-up occurred is 0x2dd60 bytes away from the start of the .exe or .dll file. |
Opcode |
The lower 16 bits of the opcode contain the lower 16 bits of the address where the fix-up is required. |
Opcode address |
Address of the opcode within the Nk.bin run-time image. This is the load address of the run-time image as defined by the NK memory section in the Config.bib file, 0x80600000, plus the offset defined by adding together the values for relocation offset and the relocation page (in this example, 0x2dd60). |
EXE opcode address |
Address of the opcode within Nk.exe. This is the preferred load address of the .exe file, 0x8c580000, plus the offset, 0x2dd60. |
When you encounter an invalid fix-up in ROM, you can fix it by performing the following steps.
To resolve an invalid fix-up
In the Nk.map file, locate the symbol with the largest address not exceeding the EXE opcode address.
This is the closest function name that is not static.
Take the difference between the EXE opcode address and the symbol address to find the offset from the symbol address.
The symbol line also describes an object file, such as Fwp2.obj. This information identifies the object file, and thus the source file.
Set WINCECOD=1 and compile the source file.
Locate the symbol in the .cod file resulting from the compile, and use the calculated offset to locate the instruction that caused the invalid fix-up.
Insert the following lines of code around the function that contains the instruction.
#pragma optimize("",off) ... #pragma optimize("",on)
If the file containing the invalid fix-up is an assembly file, you must examine the file to ensure that the fix-ups are in HIGHADJ/LOW pairs.