5-2
Linker
Code or data in these sections is placed in the appropriate external
instruction or data memory, with the particular external page selected by
the number in the section name.
On the ZSP400 architecture, the offset of a
call immediate
instruction
must be even. If the assembler cannot resolve this offset, the linker will.
If the offset is odd, the linker displays an error message. Because the
assembler will automatically align
call immediate
instructions on an
even address, this error occurs only if the call target was on an odd
address. To resolve this error, align the call target on an even address,
using the
.walign 2
directive.
5.1.1 Symbols
By default, program execution begins at
__start
. The entry point can be
altered by specifying an alternate address, using the
-e
option. For
example, the following command will cause execution to begin at address
0xabcd:
sdld -e 0xabcd
The C stack region will always be set to the internal data memory. The
linker uses four symbols for stack-range checking:
__stack_start
: beginning of C stack, default setting is 0xF7FF with
SDLD and 0xFFEFFF with ZDLD.
__stack_end
: ending address of C stack
__stack_size
.
linker_defined
: stack size calculated by linker
__stack_size
.
user_required
: user required stack size set in
command line option
You can inspect the values of these symbols in the map file.
The value of the symbol
__stack_start
or
__stack_end
can be set in
a linker script file or by using the command-line option
defsym
sym=Value
.
The user-required stack size can be set using the command-line option
stack_size=Value
. The linker will report an error when the stack size is
inadequate.