Nios® V Embedded Processor Design Handbook

ID 726952
Date 10/31/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

4.2. Linking Applications

When you generate the Nios® V processor project, the BSP Editor generates two linker related files:
  • linker.x: The linker command file that the generated application's makefile uses to create the .elf binary file.
  • linker.h: Contains information about the linker memory layout.
All linker setting modifications you make to the BSP project affect the contents of these two linker files.
Every Nios® V processor application contains the following linker sections:
Table 11.  Linker Sections
Linker Sections Descriptions
.text Executable code.
.rodata Any read-only data used in the execution of the program.
.rwdata Stores read-write data used in the execution of the program.
.bss Contains uninitialized static data.
.heap Contains dynamically allocated memory.
.stack Stores function-call parameters and other temporary data.
You can add additional linker sections to the .elf file to hold custom code and data. These linker sections are placed in named memory regions, defined to correspond with physical memory devices and addresses. By default, BSP Editor automatically generates these linker sections. However, you can control the linker sections for a particular application.