Specifications

176 www.xilinx.com Embedded System Tools Guide (EDK 6.2i)
1-800-255-7778 UG111 (v1.4) January 30, 2004
Chapter 11: GNU Compiler Tools
R
-relax
This is a linker option, used to remove all the unwanted imm instructions generated by the
assembler. The assembler generates imm instruction for every instruction where the value
of the immediate can not be calculated during the assembler phase. Most of these
instructions won’t need an imm instruction. These are removed by the linker when the -
relax command line option is provided to the linker.
This option is required only when linker is invoked on its own. When linker is invoked
through the mb-gcc compiler, this option is automatically provided to the linker.
-N
This option sets the text and data section to be readable and writable. It also does not page-
align the data segment. This option is required only for MicroBlaze programs. The top
level gcc compiler automatically includes this option, while invoking the linker, but if you
intend to invoke the linker without using gcc, you should have use this option.
For more details on this option, please refer to the GNU manuals online at
http://www.gnu.org/manual/manual.html
Initialization Files
The final executable needs certain registers such as the small data area anchors (R2 and
R13) and the stack pointer (R1) to be initialized. These C-Runtime files also set up the
interrupt and exception handler routines.
These initialization files are distributed with the Embedded Development Kit. In addition
to the precompiled object files, source files are also distributed in order to help user make
their own changes as per their requirements. Initialization can be done using one of the
three C runtime routines:
crt0.o
This initialization file is to be used for programs which are to be executed standalone, i.e
without the use of any bootloader or debugging stub (such as xmdstub).
crt1.o
This file is located in the same directory and should be used when software intrusive
debugging (XMDstub) is used. crt1.o returns the control of the program back to the
XMDStub on completion of user program.
crt4.o
When the kernel module is used in a particular MicroBlaze system, crt4.o is used as the
startup file by the compiler. crt4.o does not set up the interrupt and exception handlers
since the default handling of the interrupts and exceptions are done by MicroKernel. This
crt also return the control back to the Kernel on completion of the user program.
The source for initialization files is available in the
<XILINX_EDK>/sw/lib/microblaze/src directory,
i <XILINX_EDK> : Installation area
These files can be changed as per the requirements of the project. These changed files have
to be then assembled to generate an object file (.o format). To refer to the newly created