11.5.1 Standard Data Section Names

Traditionally, linkers based on the GNU technology support three sections in the linked binary file:

Table 11-1. Traditional Section Names
Section NameDescriptionAttribute
.textexecutable codecode
.datadata memory that receives initial valuesdata
.bssdata memory that is not initializedbss

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).

Note: Whenever a section directive is used, all declarations that follow are assembled into the named section. This continues until another section directive appears, or the end of file. For more information on defining sections and section attributes, see Directives that Define Sections.