Hello again,
I have a question about how the Linker uses the Linker Command file.
Say that I have the following sections ( in this order)
1) Section A
2) Section B
3) Section C
Now after linking my program and checking the addresses I notice that the section have been allocated.
1) Section B
2) Section C
3) Section A
Why does the linker change the order of the sections specified in the linker command file?
The GROUP command will not work here as the RUN address are different.
Here is an example problem. I would like to run the sin function out of RAM but leave the rest of library in FLASH to do this I have instrumented code similar to the following.
.sectionA: RUN = RAM PAGE = 1 LOAD = FLASH PAGE = 0
{
rts2800_fpu32.lib <sin.obj> (.text)
}
.sectionB LOAD = FLASH PAGE = 0
{
*(.text)
}
If the linker followed this order SectionA (.text) would have sin.obj allocated in it and then SectionB would contain the remaining .text sections from the other objects.
Instead the Linker is allocating SectionB (.text) first which mean that when SectionA is allowed there is no matching .text section as it has been pulled in by sectionB.
Can someone please help me understand where my mistake is?
Thanks,
Paul