MicroBlaze Linker Options - 2025.2 English - UG1400

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document ID
UG1400
Release Date
2025-11-20
Version
2025.2 English

The mb-ld linker for the MicroBlaze soft processor provides additional options to those supported by the GNU compiler tools.

-defsym _TEXT_START_ADDR=value
By default, the text section of the output code starts with the base address 0x28. This can be overridden by using the -defsym _TEXT_START_ADDR option. If this is supplied to mb-gcc compiler, the text section of the output code starts from the given value.

You do not have to use -defsym _TEXT_START_ADDR if you are using the default start address set by the compiler.

This is a linker option used when you invoke the linker separately. If the linker is being invoked as a part of the mb-gcc flow, you must use the following option:

-Wl,-defsym -Wl,_TEXT_START_ADDR=value
-relax
This is a linker option that removes all unwanted imm instructions generated by the assembler. The assembler generates an imm instruction for every instruction where it cannot determine the value of the immediate one. Most of these instructions do not need an imm instruction. These are removed by the linker when the -relax command line option is provided.

The assembler only requires this option when invoking the linker on its own. When the linker is invokes through the mb-gcc compiler, the system automatically provides this option.

-N
Required only for MicroBlaze programs, this option sets the text and data section as readable and writable. It does not page-align the data segment. The top-level GCC compiler automatically includes this option while invoking the linker. If you intend to invoke the linker without using GCC, use this option.

The MicroBlaze linker uses linker scripts to assign sections to memory. See the following for details.