Specifications

Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 319
UG111 (v1.4) January 30, 2004 1-800-255-7778
PowerPC Processor
R
$XILINX_EDK/gnu/powerpc-eabi/nt(or sol)/powerpc-
eabi/lib/ldscripts, where $XILINX_EDK is the EDK installed directory. These
scripts are imbibed into the linker and hence any changes to these scripts will not be
reflected.
The choice of the default script that will be used by the linker from the
$XILINX_EDK/gnu/powerpc-eabi/nt(orsol)/powerpc-eabi/lib/ldscripts
area are described as below:
x elf32ppc.x is used by default when none of the following cases apply
x elf32ppc.xn is used when the linker is invoked with the {-n} option.
x elf32ppc.xbn is used when the linker is invoked with the {-N} option.
x elf32ppc.xr is used when the linker is invoked with the {-r} option.
x elf32ppc.xu is used when the linker is invoked with the {-Ur} option.
x elf32ppc.x is used when the linker is invoked with the {-n} option.
For a more detailed explanation of the linker options, please refer to the GNU linker
documentation at (
http://www.gnu.org/manual).
Minimal Linker Script
You must write a linker script if you want to control how your program is targeted to
Instruction Cache, ZBTor External Memory.
You will need to provide a linker script to powerpc-eabi-gcc using the following command:
powerpc-eabi-gcc -Wl,-T -Wl,linker script file1.c file2.c -
save-temps
This tells powerpc-eabi-gcc to use your linker script only, and to not use the default (built-
in) one. The Linker Script defines the layout and the start address of each of the sections for
the output executable file.
Restrictions
Note that if you choose to write a linker script, you must do the following to ensure that
your program will work correctly. An example linker script is given which incorporates
these restrictions. Each of the restriction is highlighted in the example linker script.
x Allocate space in the .bss section for stack and heap. Set the _stack variable to the
location after_ STACK_SIZE locations of this area, and the _heap_start variable to
the next location after _STACK_SIZE location. Since the stack and heap need not be
initialized for hardware as well as simulation, define __bss_end variable after the
bss and COMMON defintions. See the .bss section in the example script below to see
how this is done.
x Ensure that the variables __SDATA_START__. __SDATA_END__,
SDATA2_START, __SDATA2_END__, __SBSS2_START__ , __SBSS2_END__,
__bss_start, __bss_end, __sbss_start and __sbss_end are defined to
the beginning and end of the sections sdata, sdata2, sbss2, bss, sbss respectively. See
example below to see how this is done.
x Ensure that the .sdata and the .sbss sections are contiguous.
x Ensure that the .sdata2 and the .sbss2 sections are contiguous.
x Ensure that the .boot section starts at 0xFFFFFFFC.