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

Linker Error 112

Hi,
i'm using a C167CS-LM, and i want to locate code to specific adresses in my external FLASH (AMD 29F400).
I get the following linker Error, which i can't get fixed:

*** ERROR L112: SECTION DOES NOT FIT WITHIN GROUP RANGE
SECTION: ?PR?MAIN
CLASS: NCODE

In my linker command file i use the SECTIONS directive which includes the name FLALGO. I used it to rename the class NCODE in one file.

Here my linker command file:

F1.obj, F2.obj, F3.obj TO Name.abs CLASSES (&
ICODE (0X0200-0X3FFF),&
NDATA (0X8000-0X9FEF),&
SDATA (0XC000-0XD7FF, 0XE000-0XE7FF),&
IDATAX (0XF200-0XFDDF),&
BDATAX (0XFDE0-0XFDFD),&
NCODE (0X10000-0X2FFFF))&
SECTIONS (?PR?FLASHOS%FLALGO (0XF300)[0X25000])

It works if i don't use the SECTIONS directive. It also works if i change the start adress of NCODE to 0x0, but i want to locate all my code at 0x10000 or higher...

Thanks for any comments and hints.
Mario Arn

  • Hi Mario.

    I suspect that the linker complains about the executable code not being in a single 64K segment.
    I've had experience with relocating code from ROM to RAM for execution. I put the code to be relocated in a single *.C file and put #pragma LARGE and #pragma RENAMECLASS (FCODE=MYCODE) in that file. The rest of the program was compiled in small memory model. For some reason small memory model and #pragma RENAMECLASS (NCODE=MYCODE) didn't work with that file. Try #pragma LARGE in your program, maybe it will solve the problem. It will give the warning 'Incompatible memory model' or something like that, but it can be ignored if you know what you are doing.

    - mike

  • Thx very much for your quick answer mike...but it didn't work. If i put the pragma directive #pragma LARGE in my file, i get the following fatal ERROR:

    C166 FATAL-ERROR -
    ACTION: PARSING INVOKE-/#PRAGMA-LINE
    LINE: #pragma LARGE
    ERROR: RESPECIFIED OR CONFLICTING CONTROL


    Maybe there is another solution to solve this "little" problem?

    Thx in advance,
    Mario

  • It looks like the compiler was invoked with a command line that specifies small memory model which conflicts with #pragma LARGE.
    Basically the idea behind my advice was to compile that one file in large memory model and the rest of the program - in small memory model. So try changing small to large for that file.

    - mike