Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

6.15.1. Memory Sections

By default, HAL-based systems are linked using a generated linker script that is created by the Nios II SBT. This linker script controls the mapping of code and data to the available memory sections. The autogenerated linker script creates standard code and data sections (.text, .rodata, .rwdata, and .bss), plus a section for each physical memory device in the system. For example, if a memory component named sdram is defined in the system.h file, there is a memory section named .sdram.

The memory devices that contain the Nios II processor’s reset and exception addresses are a special case. The Nios II tools construct the 32-byte .entry section starting at the reset address. This section is reserved exclusively for the use of the reset handler. Similarly, the tools construct a .exceptions section, starting at the exception address.

In a memory device containing the reset or exception address, the linker creates a normal (nonreserved) memory section above the .entry or .exceptions section. If there is a region of memory below the .entry or .exceptions section, it is unavailable to the Nios II software.