Nios® V Processor Software Developer Handbook

ID 743810
Date 7/08/2024
Public
Document Table of Contents

5.2.3.3.1. Creating a Linker Section for an Existing Region

To create your own section named special_section that is mapped to the linker region named onchip_special, use the following niosv-bsp command:

When creating a new BSP:
niosv-bsp –-create –-qsys=<Platform Designer system> --type=hal 
--cmd=”add_section_mapping special_section onchip_special” settings.bsp

When updating an existing BSP (first update):

niosv-bsp –-update --cmd=”add_section_mapping special_section onchip_special” settings.bsp

When the niosv-bsp generates the linker script linker.x, the linker script has a new section mapping. The order of section mappings in the linker script is determined by the order in which the add_section_mapping command creates the sections. If you use niosv-bsp, the default Tcl script runs before the --cmd option that creates the special_section section.

If you update your BSP, you do not need to provide the add_section_mapping command again because the default Tcl script only modifies section mappings for the default sections (.entry, .exceptions, .text, .rodata, .rwdata, .bss, .heap, and .stack).