| |||||
Technical Support Support Resources
Product Information | BL51: ERROR 121 (IMPROPER FIXUP) WITH ROM(SMALL)Information in this article applies to:
SYMPTOMSI 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. CAUSEYou'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("\n");
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:\TRY\CODEHOG (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. RESOLUTIONChange the program to reduce the amount of code space it requires, or use a memory model that allows more code space. MORE INFORMATION
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Tuesday, July 19, 2005 | ||||
| |||||