Specifications

318 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
Advanced User Address Space
Different Base Address, Contiguous User Address Space
The user program can run from any memory. By default, the compiler places the user
program at location 0xFFFF0000. To execute the program from any address location other
than the default, users must provide the compiler powerpc-eabi-gcc with additional
option.
The option required is
-Wl,-defsym -Wl,_START_ADDR=start_address
where start_address is the new base address required for the user program.
Different Base Address, Non-contiguous User Address Space
The users can place different components of their program on different memories. For
example, on PowerPC systems users can keep their code on instruction cache memory and
the data on ZBT memory.
All such user programs need the creation of a non-contiguous executables. To facilitate
creation of non-contiguous executable, linker scripts must be modified. The default linker
script provided with the Embedded Distribution Kit will place all user code and data in
one contiguous address space.
Linker scripts are defined in later sections in this chapter.
For more details on linker options, see Chapter 11, “GNU Compiler Tools.”
Linker Script
PowerPC Linker is built with default linker scripts. This script assumes a contiguous
memory starting from address 0xFFFF0000. The script defines boot.o as the first file to be
linked. boot.o is present in the libxil.a library which is created by the LibGen tool. The
script defines the start address to be 0xFFFF000. If the user has given the start address
through the linker option as:
-Wl, -defsym -Wl,_START_ADDRESS=0xFFFF8000
In this case, the start address would be 0xFFFF8000. The script starts assigning addresses to
different sections of the final executable - .vectors, .text, .rodata, .sdata2, .sbss2, .data, .got1,
.got2, .fixup, .sdata, .sbss, .bss, .boot0 and .boot in that order. As it assigns the addresses,
the script defines the following start and end of sections variables - __SDATA2_START__,
__SDATA2_END__, __SBSS2_START__, __SBSS2_END__, __SDATA_START__,
__SDATA_END__, __sbss_start, ___sbss_start, __sbss_end, ___sbss_end,
__SDATA_START__, __SDATA_END__, __bss_start and __bss_end. These variables define
the sectional boundaries for each of the sections. Stack and heap are allocated from the bss
section. They are defined through __stack, __heap_start and __heap_end. Note however
that the bss section boundary does not include either of stack or heap. _end is defined after
the .boot0 section definition.
.boot section is fixed to start at location 0xFFFFFFFC. This section is a jump to the start of
.boot0 section. The jump is defined to be 24 bits. Hence the boot and boot0 section should
not have a difference of the more than 24 bits. The reason that .boot section is at
0xFFFFFFFC is because of the fact that PowerPC405 processor on powerup, starts
execution from the location 0xFFFFFFFC.
You can take a look at the default linker scripts used by the linker at: