AnsweredAssumed Answered

Small data relocation linker problem

Question asked by Bill Shaw on Jul 14, 2011
Latest reply on Jul 15, 2011 by Bill Shaw

I'm using Codewarrior 5.9.0 for PPC to build an app for a MPC5554.  This app previously compiled using command line tools,  I'm trying to set up the project in the IDE. So far I have gotten it to compile but I'm getting link errors:

 

 

Link Error   : Small data relocation (109) in function 'C_Runtime_Init'
in referencing file 'c_runtime_init.o'
requires that symbol '_zero_init_data_start'
in symbol definition file 'linker command file'
be in a small data section but is in the equivalent of a large data section;
referencing file may have been compiled with different small data thresholds than the symbol definition file
or the extern declaration for symbol is inconsistent with the symbol's definition.

 

The code it's complaining about looks like this....

 

  /* declare local variables */
  U32 const *L_Source; //
  U32       *L_Destination;
 
  /* clear all zero initialized RAM data to zero */
  L_Destination = (U32 *)(&_zero_init_data_start);
  while (L_Destination < (U32 *)(&_zero_init_data_end))
  {
    /* zero data and increment pointer */
    *L_Destination = 0;
    ++L_Destination;
  }


in the MEMORY section of my LCF I have

 

  zero_init_data:         org = 0x20001000,   len = 0x000FF000

 

and near the bottom of the lcf I have some address designations like...

 

_zero_init_data_start       = ADDR(zero_init_data);
_zero_init_data_end         = ADDR(zero_init_data) + SIZEOF(zero_init_data);

 

This worked in the command line / makefile environment but I'm have\ing trouble getting it to work in the IDE.  Does anyone have an idea what the problem is here?

 

Thanks in advance,

 

Bill

Outcomes