11.5.1 Standard Data Section Names
Traditionally, linkers based on the GNU technology support three sections in the linked binary file:
Section Name | Description | Attribute |
---|---|---|
.text | executable code | code |
.data | data memory that receives initial values | data |
.bss | data memory that is not initialized | bss |
The name “bss” dates back several decades, and means memory “Block Started by Symbol.” By convention, bss memory is filled with zeros during program start-up.
The traditional section names are considered to have implied attributes as
listed in the table above. The code
attribute indicates
that the section contains executable code and should be loaded in program memory. The
bss
attribute indicates that the section contains data
storage that is not initialized, but will be filled with zeros at program start-up. The
data
attribute indicates that the section contains
data storage that receives initial values at start-up.
Assembly applications may define additional sections with explicit attributes using the section directive described in Directives that Define Sections. For C applications, the MPLAB XC32 C Compiler for PIC32A MCU will automatically define sections to contain variables and functions as needed. For more information on the attributes of variables and functions that may result in automatic section definition, see the “MPLAB® XC32 C Compiler User’s Guide for PIC32A MCU(DS-50003831).