Specifications
Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 169
UG111 (v1.4) January 30, 2004 1-800-255-7778
Compiler Usage and Options
R
Linker Options
-defsym _STACK_SIZE=value
The total memory allocated for the stack and the heap can be modified by using the above 
linker option. The variable STACK_SIZE is the total space allocated for heap as well as the 
stack. The variable STACK_SIZE is given the default value of 100 words (i.e 400 bytes). If 
any user program is expected to need more than 400 bytes for stack and heap together, it is 
recommended that the user should increase the value of STACK_SIZE using the above 
option. This option expects value in bytes. 
In certain cases, a program might need a bigger stack. If the stack size required by the 
program is greater than the stack size available, the program will try to write in other 
forbidden section of the code, leading to wrong execution of the code. 
Note: For MicroBlaze systems, minimum stack size of 16 bytes (0x0010) is required for programs 
linked with the C runtime routines (crt0.o and crt1.o). 
Linker Scripts
The linker utility makes use of the linker scripts to divide the user’s program on different 
blocks of memories. To provide a linker script on the gcc command line, use the following 
command line option:
<compiler> -Wl,-T -Wl,linker_script <Other Options and Input Files>
If the linker is executed on its own, the linker script could be included as follows:
<linker> -T linker_script <Other Options and Input Files>
For more information about usage of linker scripts, please refer to Chapter 22, “Address 
Management”
Search Paths
The compilers (mb-gcc and powerpc-eabi-gcc) search certain paths for libraries and 
header files. 
On Solaris
Libraries are searched in the following order:
1. Directories passed to the compiler with the -L dir name option.
2. Directories passed to the compiler with the -B dir name option.
3. ${XILINX_EDK}/gnu/processor
(1)
/sol/microblaze/lib
4. ${XILINX_EDK}/lib/processor
Header files are searched in the following order:
1. Directories passed to the compiler with the -I dir name option.$
2. ${XILINX_EDK}/gnu/processor/sol/processor/include
1. Processor indicates powerpc-eabi for PowerPC and microblaze for MicroBlaze










