How to Save On-Chip Memory by Placing RTS Off-Chip
4-10
The .rtsdata section combines all of the defined data sections together. De-
fined data sections both reserve and initialize the contents of a section. You
use the .sect assembler directive to create defined sections.
It is necessary to build and allocate the undefined data sections separately
from the defined data sections. When a defined data section is combined to-
gether with an undefined data section, the resulting output section is a defined
data section, and the linker must fill the range of memory corresponding to the
undefined section with a value, typically the default value of 0. This has the un-
desirable effect of making your resulting .out file much larger.
You may get a linker warning like:
>> farlnk.cmd, line 65: warning: rts6200.lib(.switch) not
found
That means none of the RTS functions needed by your application define a
.switch section. Simply delete the corresponding –l entry in the linker com-
mand file to avoid the message. If your application changes such that you later
do include an RTS function with a .switch section, it will be linked next to the
.switch sections from your code. This is fine, except it is taking up that valuable
on-chip memory. So, you may want to check for this situation occasionally by
looking at the linker map file you create with the –m linker option.
Note:
Library Listed in Command File and On Command Line
If a library is listed in both a linker command file and as an option on the com-
mand line (including make files), check to see that the library is referenced
similarly.
For example, if you have:
.rtstext {–lrts6200.lib(text)} > EXT0
and you build with:
cl6x <options> <files> –z –1<path>rts6200.lib
you might receive an error message from the linker. In this case, check to see
that both references either contain the full pathname or assure that neither
of them don’t.
4.2.5
Example Compiler Invocation
A typical build could look like:
cl6x –mr1 <other options> <C files> –z –o app.out
–m app.map farlnk.cmd
In this one step you both compile all the C files and link them together. The
C6000 executable image file is named app.out and the linker map file is named
app.map.