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

IMPROPER FIXUP

I realized that I didn't want Level 9 (Common Block Subroutine Packing)
optimizations performed on my code. Now, going back to Level 8
optimizations, I get IMPROPER FIXUP errors in my assembly
startup code.

What's the deal?

Parents
  • A couple of things:

    1) Why would going to optimization level 9, fix the IMPROPER FIXUP problem?

    2) When I take my startup.a51 and only include one other C file (with
    my main() function, I do not get any IMPROPER FIXUP linker
    errors.

    3) What is an email address that I can send my code to? The code
    is fairly simple.

Reply
  • A couple of things:

    1) Why would going to optimization level 9, fix the IMPROPER FIXUP problem?

    2) When I take my startup.a51 and only include one other C file (with
    my main() function, I do not get any IMPROPER FIXUP linker
    errors.

    3) What is an email address that I can send my code to? The code
    is fairly simple.

Children
  • 1) Why would going to optimization level 9, fix the IMPROPER FIXUP problem?

    No idea.

    2) When I take my startup.a51 and only include one other C file (with my main() function, I do not get any IMPROPER FIXUP linker errors.

    OK. When you do get improper fixup errors, the linker will tell you where the problem exists. Have you looked at that line of your source code to see what the problem could be?

    3) What is an email address that I can send my code to? The code is fairly simple.

    support@keil.com

    Keil Support

  • For those following this thread, the Keil Support Team came up with
    this answer:

    The problem you are seeing is due to the ACALLs in your startup
    code. The improper fixup is telling you that the label the ACALLs are
    referencing is not located in the same 2K page as the ACALLs themselves.
    There are 2 solutions to this problem:

    1. USE LCALLs.

    2. Change the declaration of the startup segment so that it starts at the
    beginning of a 2K boundary. Change the declaration for that segment to the
    following and your program will link with no errors:

    ?C_C51STARTUP SEGMENT CODE INBLOCK


    I assume that when Code Optimization Level 9 was being used, all my
    startup code happened to fit in the same 2K block, and when level 8
    was used, some of my 'bloated' C code got injected in the startup space
    blowing it up to greater than 2K for the ACALL.