SPRAB89A September 2011 – March 2014
The System V ABI, along with other base documents and other sections of this ABI, defines several sections with dedicated purposes. Table 13-4 consolidates dedicated sections used by the C6000 and groups them by functionality.
Section names are not mandated by the ABI. Special sections should be identified by type, not by name. However, interoperability among toolchains can be improved by following these conventions. For example, using these names may decrease the likelihood of having to write custom linker commands to link relocatable files built by different compilers.
The ABI does mandate that a section whose name does match an entry in the table must be used for the specified purpose. For example, the compiler is not required to generate code into a section called .text, but it is not allowed to generate a section called .text containing anything other than code.
All of the section names listed in the table that follows are prefixes. The type and attributes apply to all sections with names that begin with these strings.
Prefix | Type | Attributes |
---|---|---|
Code Sections | ||
.text | SHT_PROGBITS | SHF_ALLOC + SHF_EXECINSTR |
.plt | SHT_PROGBITS | SHF_ALLOC + SHF_EXECINSTR |
Near Data Sections | ||
.bss | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.neardata | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE |
.rodata | SHT_PROGBITS | SHF_ALLOC |
Far Data Sections | ||
.far | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.fardata | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE |
.const | SHT_PROGBITS | SHF_ALLOC |
.fardata:const | SHT_PROGBITS | SHF_ALLOC |
Dynamic Data Sections | ||
.got | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE |
.dsbt | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE |
Exception Handling Data Sections | ||
.C6000.exidx | SHT_C6000_UNWIND | SHF_ALLOC + SHF_LINK_ORDER |
.C6000.extab | SHT_PROGBITS | SHF_ALLOC |
Initialization and Termination Sections | ||
.init | SHT_PROGBITS | SHF_ALLOC + SHF_EXECINSTR |
.fini | SHT_PROGBITS | SHF_ALLOC + SHF_EXECINSTR |
.preinit_array | SHT_PREINIT_ARRAY | SHF_ALLOC + SHF_WRITE |
.init_array | SHT_INIT_ARRAY | SHF_ALLOC + SHF_WRITE |
.fini_array | SHT_FINI_ARRAY | SHF_ALLOC + SHF_WRITE |
ELF Structures | ||
.rel | SHT_REL | None |
.rela | SHT_RELA | None |
.symtab | SHT_SYMTAB | None |
.symtab_shndx | SHT_SYMTAB_SHNDX | None |
.strtab | SHT_STRTAB | SHF_STRINGS |
.shstrtab | SHT_STRTAB | SHF_STRINGS |
.note | SHT_NOTE | None |
Dynamic Loading Structure | ||
.dynamic (1) | SHT_DYNAMIC | SHF_ALLOC |
.dynsym (1) | SHT_DYNSYM | SHF_ALLOC |
.dynstr (1) | SHT_STRTAB | SHF_ALLOC + SHF_STRINGS |
.hash (1) | SHT_TAB | SHF_ALLOC |
.interp | SHT_PROGBITS | None |
Build Attributes | ||
.C6000.attributes | SHT_C6000_ATTRIBUTES | None |
Symbolic Debug Sections | ||
.debug (2) | SHT_PROGBITS | None |
Symbol Versioning Sections(1) | ||
.gnu.version | SHT_GNU_versym | SHF_ALLOC |
.gnu.version_d | SHT_GNU_verdef | SHF_ALLOC |
.gnu.version_r | SHT_GNU_verneed | SHF_ALLOC |
Sections for Thread-Local Storage | ||
.tbss | SHT_NOBITS | SHF_ALLOC + SHF_WRITE + SHF_TLS |
.tdata | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE + SHF_TLS |
.tdata1 | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE + SHF_TLS |
.TI.tls_init | SHT_PROGBITS | SHF_ALLOC |
TI Toolchain-Specific Sections | ||
.stack | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.sysmem | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.cio | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.switch | SHT_PROGBITS | SHF_ALLOC |
.binit | SHT_PROGBITS | SHF_ALLOC |
.cinit | SHT_TI_INITINFO | SHF_ALLOC |
.const:handler_table | SHT_PROGBITS | SHF_ALLOC |
.ovly | SHT_PROGBITS | SHF_ALLOC |
.ppdata | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.ppinfo | SHT_NOBITS | SHF_ALLOC + SHF_WRITE |
.TI.crctab | SHT_PROGBITS | SHF_ALLOC |
.TI.icode | SHT_TI_ICODE | None |
.TI.phattrs | SHT_TI_PHATTRS | None |
.TI.preempt.map | SHT_C6000_PREEMPTMAP | SHF_ALLOC |
.TI.xref | SHT_TI_XREF | None |
.TI.section.flags | SHT_TI_SH_FLAGS | None |
.TI.symbol.alias | SHT_TI_SYMALIAS | None |
.TI.section.page | SHT_TI_SH_PAGE | None |
Sections in the System V ABI but Unused by the C6000 EABI | ||
.comment | ||
.data | ||
.data1 | ||
.line | ||
.rodata1 |
The "TI Toolchain-Specific Sections" sections in the previous table are used by the TI toolchain in various toolchain-specific ways. The ABI does not mandate the use of these sections (although interoperability encourages their use), but it does reserve these names.
The "Sections in the System V ABI but Unused by the C6000 EABI" sections in the previous table are specified by the System V ABI, but are not used or defined under the C6000 ABI. Other sections are used by TI for other devices; these names are reserved.
See Chapter 7 for details about thread-local storage.
In addition, .common and .scommon are section names used by the linker. These are abstract sections, not actual sections in the object files. The names are a convention in the linker command file for placing variables. These sections should not be used for other purposes.