Specifications

310 www.xilinx.com Embedded System Tools Guide (EDK 6.2i)
1-800-255-7778 UG111 (v1.4) January 30, 2004
Chapter 22: Address Management
R
System with only an executable [No debug, No Bootstrap]
The scenario is depicted in Figure 22-2(a). The C-runtime file crt0.o is linked with the user
program. The system file, crt0.o starts at address location 0x0, immediately followed by
user’s program.
System with debugging support
With systems requiring debug support, xmdstub must be downloaded at address location
0x0. The C-runtime file crt1.o is bundled with the user program and is place at a default
location. This scenario is shown in Figure 22-2(b).
System with bootstrap support
The user can also bootstrap their program by using the bootstub. This bootstub occupies
the system address space starting at address location 0x0. In addition to this system space,
every user program is pre-pended with another C-runtime routine crt2.o or crt3.o
depending on the compilation switch used. This scenario is shown in Figure 22-2(c).
Default User Address Space
The default usage of the compiler mb-gcc will place the users program immediately after
the system address space. The user does not have to give any additional options in order to
make space for the system files. The default start address for user programs is described in
Table 22-1
If the user needs to start the program at a location other than the default start address or if
non-contiguous address space is required, advanced address space management is
required.
Advanced User Address Space
Different Base Address, Contiguous User Address Space
The user program can run from any memory [ that is, LMB memory or OPB memory]. By
default, the compiler will place the user program at location defined in Table 22-1. To
execute a program from any address location other than default, users must provide the
compiler mb-gcc with an additional option.
The option required is
-Wl,defsym -Wl,_TEXT_START_ADDR=start_address
where start_address is the new base address required for the user program.
Table 22-1: Start address for different compilation switches
Compile Option Start Address
-xl-mode-executable 0x0
-xl-mode-xmdstub 0x400
-xl-mode-bootstrap 0x100
-xl-mode-bootstrap-reset 0x100