MPC: Link Error   : Relocation (10) of symbol 'memcpy'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC: Link Error   : Relocation (10) of symbol 'memcpy'

1,686 Views
whatever
Contributor I
I am using CodeWarrior Development Studio, PPC ISA Comm. Processor Edition, version 8.1.4 Build 400817
 
When I tried to move the .text section from ROM to RAM I get the following link error message:
 
Link Error   : Relocation (10) of symbol 'memset'
in 'E:\Products\EPPC\Layout\PowerPC_EABI_Support\MSL\MSL_C\MSL_Common\Src\alloc.o' of archive 'MSL_C.PPCEABI.bare.S.UC.a'
is out of range.

Link Error   : Relocation (10) of symbol 'memcpy'
in 'E:\Products\EPPC\Layout\PowerPC_EABI_Support\MSL\MSL_C\MSL_Common\Src\direct_io.o' of archive 'MSL_C.PPCEABI.bare.S.UC.a'
is out of range.

Link failed.
 
When I did a google search on the problem, I found that someone else had an error like this and reported it in June 2005 and actually got a support number (SR 1-62972411), but I could not find any resolution.
 
Have anyone found a fix to this problem? Or do I have to just not use the libraries and compile my own?

Message Edited by CrasyCat on 2007-04-13 11:35 AM

Labels (1)
0 Kudos
1 Reply

444 Views
CrasyCat
Specialist III
Hello
 
Issue probably comes from the startup code. I assume you are using memset or memcpy in your own code. Am I right?
 
Basically the startup code (actually __copy_rom_section & __init_bss_section) are also using these functions. Usually when you are running code from RAM, the startup code stays in the bootloader (i.e. runs out of flash). When the startup code tries to execute the function memcpy and memset, code is not copied in RAM yet. So it cannot work.
I would recommend you to use your own function located in section .init to copy data from ROM to RAM.
 
A kind of duplicate from memcpy and memset, but allocated in section .init.
 
If this does not help, you may want to submit an SR through our web interface for that.
 
CrasyCat
0 Kudos