Define Stack Size (–Stack Constant Option) - Texas Instruments TMS320C54x User Manual

Digital signal processors
Table of Contents

Advertisement

Linker Options
7.4.16 Define Stack Size (–stack constant Option)
7.4.17 Introduce an Unresolved Symbol (–u symbol Option)
7-18
The TMS320C54x C compiler uses an uninitialized section, .stack, to allocate
space for the runtime stack. You can set the size of the .stack section at link
time with the –stack option. Specify the size in words as a constant immedi-
ately after the option:
lnk500 –stack 0x1000 /* defines a stack size */
If you specified a different stack size in an input section, the input section stack
size is ignored. Any symbols defined in the input section remain valid; only the
stack size will be different.
When the linker defines the .stack section, it also defines a global symbol,
_ _STACK_SIZE, and assigns it a value equal to the size of the section. The
default stack size is 1K words.
The –u option introduces an unresolved symbol into the linker's symbol table.
This forces the linker to search a library and include the member that defines
the symbol. The linker must encounter the –u option before it links in the
member that defines the symbol.
For example, suppose a library named rts.lib contains a member that defines
the symbol symtab; none of the object files being linked reference symtab.
However, suppose you plan to relink the output module, and you would like to
include the library member that defines symtab in this link. Using the –u option
as shown below forces the linker to search rts.lib for the member that defines
symtab and to link in the member.
lnk500 –u symtab file1.obj file2.obj rts.lib
If you do not use –u, this member is not included because there is no explicit
reference to it in file1.obj or file2.obj.

Advertisement

Table of Contents
loading

Table of Contents