ARM Technical Support Knowledge Articles

ERROR 121 (IMPROPER FIXUP) WITH ROM(SMALL)

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


SYMPTOMS

I have a program that compiles and links just fine until I enable a function call to the library routine ceil().

My memory model is small, rom(small).

If I comment out the call to ceil, it's ok. With ceil in, I get linking errors everywhere. They are all 121 - improper fixup errors. They happen at every function call in the program, as well as during references to various code const segments.

CAUSE

You're probably running out of code space. The floating point version of the runtime library uses up most (1304 bytes in version 5.5) of the 2K available.

The following simple program causes the same problem:

#include <stdio.h>

float
foo(
   float x)
{
   return x;
}

void
main(void)
{
   foo(2.5);
   printf("
");
   while (1);
}

To verify that this is the cause of the problem, set the linker options to create a map file and look at the sizes of things in code memory.

For the preceding example:

LINK MAP OF MODULE:  C:TRYCODEHOG (CODEHOG)


 TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
 -----------------------------------------------------

 * * * * * * *   D A T A   M E M O R Y   * * * * * * *
 REG     0000H     0008H     ABSOLUTE     "REG BANK 0"
         0008H     0018H                  *** GAP ***
 BIT     0020H.0   0001H.1   UNIT         _BIT_GROUP_
         0021H.1   0000H.7                *** GAP ***
 DATA    0022H     001CH     UNIT         _DATA_GROUP_
 IDATA   003EH     0001H     UNIT         ?STACK

 * * * * * * *   C O D E   M E M O R Y   * * * * * * *
 CODE    0000H     0003H     ABSOLUTE
 CODE    0003H     0518H     UNIT         ?C?LIB_CODE
 CODE    051BH     0468H     UNIT         ?PR?PRINTF?PRINTF
 CODE    0983H     0027H     UNIT         ?PR?PUTCHAR?PUTCHAR
 CODE    09AAH     0017H     UNIT         ?PR?MAIN?P3
 CODE    09C1H     000CH     UNIT         ?C_C51STARTUP
 CODE    09CDH     0002H     UNIT         ?CO?P3
 CODE    09CFH     0001H     UNIT         ?PR?_FOO?P3

In this example, the runtime library code plus printf() need 518h + 468h = 980h bytes of code space, but only 800h are available.

RESOLUTION

Change the program to reduce the amount of code space it requires, or use a memory model that allows more code space.

MORE INFORMATION

Article last edited on: 2005-07-19 15:28:25

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential