AnsweredAssumed Answered

Problem with memory output organization using LDF

Question asked by idoshi on Jul 12, 2010
Latest reply on Jul 15, 2010 by CraigG

Hello,

 

I'm using TigerSHARC TS201 and trying to arrange the memory layout such as different fragments of

code/data will be placed at different memory locations.

 

There are 2 options:

1) Using section() qualifier or #pragma section/default_section within the C/C++ code modules

2) Allocating objects files to specific memory segments solely within the LDF file.

 

I have problems doing it with the second option.

My application have a lot of files so I want to use the automatic macros that expand all objects files but...

I also want to keep several files in another objects list and place it in a different memory segment.

 

In example:

 

$OBJS_SEG_0 = $main.doj, $COMMAND_LINE_OBJECTS;

$OBJS_SEG_1 = $module_x.doj, $module_y.doj, $module_z.doj

 

MEMORY

{

M0 .....

M1 ....

}

 

SECTIONS

{

     code0 { INPUT_SECTION ( $OBJS_SEG_0(program) ) } > M0

   

     code1 { INPUT_SECTION ( $OBJS_SEG_1(program) ) } > M1

     ...........

}

 

Without getting into all the little details (e.g. I haven't included the data section), should that LDF configuration works?

If I use the $COMMAND_LINE_OBJECTS macro in one objects list, does that mean the linker will place everything into "c1"

input section or it will smart enough to see that it is also included in the second input section?

How does the linker works in this case?

 

I want to control code and data placement only using the LDF file and make it flexible such as I won't need to change it every time I add

a new file to the project.

 

Thx in advance,

Idoshi

Outcomes