跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

How to check where the stack is allocated?

Latest Updated:05/18/2015

Question:

I am using the CC-RL compiler for RL78 devices and the default startup routine. How can I check where the stack is allocated?

Answer:

If you have designated the -device option for the linker, find a continuous area of RAM which is not in use, then create the following symbols.
・__STACK_ADDR_START: Highest address of the area + 1
・__STACK_ADDR_END: Lowest address of the area

The symbol list is output to the linkage list file by the –show-symbol linker option; the area between the two symbols (__STACK_ADDR_START and __STACK_ADDR_END) will be the stack area.

Example: Excerpt from linkage list

*** Symbol List ***
SECTION=
FILE=                               START        END    SIZE
SYMBOL                            ADDR        SIZE    INFO      COUNTS  OPT
__STACK_ADDR_START
000ffe20         0   none ,g         *
__STACK_ADDR_END
000fef04         0   none ,g         *

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family