This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

strange improper fixup error, pls help

I got a Improper fixup error when I link my program. It says that MODULE: ..\obj\startup.obj (?C_STARTUP) SEGMENT: ?C_C51STARTUP OFFSET: 002AH

However, I check the list file and canot figure out what's wrong. Pls help

0020 D281            171                     SETB    SDA
0022 D280            172                     SETB    SCL
0024 208103          173                     JB      SDA, IAP1
0027 208004          174                     JB      SCL, IAP_FORCE
002A 1100     F      175     IAP1:           ACALL   MARK_CHECK
002C 70D2            176                     JNZ     STARTUP1           ;jump to application
002E C280            177     IAP_FORCE:      CLR     SCL
                     178     ;delay to let win32 handle
0030 E4              179                     CLR     A
0031 FD              180                     MOV     R5, A
0032 0D              181     WAIT2:          INC     R5
0033 BD00FC          182                     CJNE    R5, #00, WAIT2
                     183                     EXTRN   CODE(tdDebugFirmware)
0036 120000   F      184                     LCALL   tdDebugFirmware
0039 020000          185                     JMP     0H
                     186
                     187
003C                 188     MARK_CHECK:

By the way, this problem can be solved if I disable the following codes
if (t_TOE.ucMenuLevel) return;
where t_TOE is a global variable.

If I enable this code, then problem occurs. How do you think? Thanks.

  • hi,

    I just found out that this problem has sth to do with the ?CO? in my program. Strange. Why function pointer tables bring along fixup error?

  • Try searching in the Knowledgebase.

    and don't forget to specify the toolset when posting!

  • It says that MODULE: ..\obj\startup.obj (?C_STARTUP) SEGMENT: ?C_C51STARTUP OFFSET: 002AH

    OK. If you look in that module at offset 00@ah, you'll see the following line:

    002A 1100     F      175     IAP1:           ACALL   MARK_CHECK
    

    The target of an ACALL instruction MUST be in the same 2K page.

    Since it is not, the linker has informed you that this type of CALL instruction cannot be used. The MARK_CHECK routine is not in the same page.

    Change the ACALL to an LCALL to solve this problem.

    I just found out that this problem has sth to do with the ?CO? in my program. Strange. Why function pointer tables bring along fixup error?

    No. It doesn't. It has to do with the fact that the MARK_CHECK function is probably not declared in an INPAGE segment. The constant table just happened to move the MARK_CHECK function out of the same page as the startup code. If it wasn't a table of function pointers it would be strings or other code that moved MARK_CHECK.

    Jon