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

How do you make the linker understand the correct length of the code

Hello

I'm using the 8K version of the C51 tools.
The code produced is less than 8192bytes. The linker thinks how ever that there is more than 8192 bytes and so doesn't complete.

The last few lines of the code placer shows that there is plenty of code space left:

CODE 1F81H 0003H INBLOCK ?PR?TD_SUSPEND?MAIN
CODE 1F84H 0003H INBLOCK ?PR?POWERON_FPGA?FPGA


******************************************************************************
* RESTRICTED VERSION WITH 2000H BYTE CODE SIZE LIMIT; USED: 2017H BYTE (100%) *
******************************************************************************

Program Size: data=128.2 xdata=4530 code=8068
LINK/LOCATE RUN COMPLETE. 0 WARNING(S), 0 ERROR(S)

Is this a bug ?

Parents
  • comment out routine x and the calls to it, note from the M51 the length of routine y and the total length of the program "A" (which now should fit). Then restore routine x and comment out routine y and the calls to it note from the M51 the length of routine x and the total length of the program "B" (which now should fit)

    so "A" + the length of x is the real length of your project.

    also "B" + the length of y is the real length of your project.


    Sometimes you have to jump through hoops to find out something, enjoy.

    Erik

Reply
  • comment out routine x and the calls to it, note from the M51 the length of routine y and the total length of the program "A" (which now should fit). Then restore routine x and comment out routine y and the calls to it note from the M51 the length of routine x and the total length of the program "B" (which now should fit)

    so "A" + the length of x is the real length of your project.

    also "B" + the length of y is the real length of your project.


    Sometimes you have to jump through hoops to find out something, enjoy.

    Erik

Children