AnsweredAssumed Answered

Powerpc ROM to RAM linker question.

Question asked by Marten Hildell on Feb 15, 2011
Latest reply on Feb 16, 2011 by Marten Hildell

Hi,

I'm trying to do something I thought was very simple, have the .data segment load address placed in ROM, but the execution address in RAM. I've done a slightly modified script from the examples.

 

I'm not using the all the __start, __init_hardware, etc things, instead I have adpated the script to the old way of doing things (for me anyway), ie code that copies from address __DATA_ROM to __DATA_RAM with size __DATA_RAM - __DATA_END.

 

The script is attempting to place the load address of .data in flash, and the execution address of .data in sram.

My problem is however that the linker seems to ignore the "LOAD(ADDR(__DATA_ROM))" part of the script. Loading the .elf will place data directly into the execution address. I had expected the __DATA_ROM to be loaded with the .data section.

So, to my questions

  1. I'm I misunderstanding the way LOAD() works?
  2. Used to ld (binutils) so I started looking in the lines of "section : { *(.data) } > ram AT> sram" and found  "sectionName : [AT (loadAddress)] {contents} > segmentName", page 206 in the "CodeWarrior Development Studio for Power Architecture® Processors Build Tools Reference". However, I've tried every possible way to get the linker to accept the AT but it just complains that it expects a "{". So, is this at all supported? (documention problem?)


Cheers,

/M


Outcomes