Chapter 4. Special Sections

Table of Contents
ELF Special Sections
Linux Special Sections

ELF Special Sections

The following sections are defined in the ELF reference specification.

Table 4-1.

NameTypeAttributes
.bssSHT_NOTESHF_ALLOC+SHF_WRITE
.commentSHT_NULL0
.dataSHT_NULLSHF_ALLOC+SHF_WRITE
.data1SHT_NULLSHF_ALLOC+SHF_WRITE
.debugSHT_NULL0
.dynamicSHT_HASHSHF_ALLOC+SHF_WRITE
.dynstrSHT_SYMTABSHF_ALLOC
.dynsymSHT_SHLIBSHF_ALLOC
.finiSHT_NULLSHF_ALLOC+SHF_EXECINSTR
.fini_array SHF_ALLOC+SHF_WRITE
.gotSHT_NULLSHF_ALLOC+SHF_WRITE
.hashSHT_RELASHF_ALLOC
.initSHT_NULLSHF_ALLOC+SHF_EXECINSTR
.init_array  SHF_ALLOC+SHF_WRITE
.interpSHT_NULLSHF_ALLOC
.lineSHT_NULL0
.noteSHT_DYNAMIC0
.pltSHT_NULLSHF_ALLOC+SHF_EXECINSTR
.preinit_array SHF_ALLOC+SHF_WRITE
.rel.bssSHT_NOBITSSHF_ALLOC
.rel.dataSHT_NOBITS0
.rel.gotSHT_NOBITSSHF_ALLOC
.rel.pltSHT_NOBITSSHF_ALLOC
.rel.textSHT_NOBITS0
.rodataSHT_NULLSHF_ALLOC
.rodata1SHT_NULLSHF_ALLOC
.shstrtabSHT_SYMTAB0
.strtabSHT_SYMTABSHF_ALLOC
.symtabSHT_PROGBITSSHF_ALLOC
.textSHT_NULLSHF_ALLOC+SHF_EXECINSTR

.bss

This section holds uninitialized data that contribute to the program's memory image. By definition, the system initializes the data with zeros when the program begins to run. The section occupies no file space, as indicated by the section type, SHT_NOBITS

.comment

This section holds version control information.

.data

This section holds initialized data that contribute to the program's memory image.

.data1

This section holds initialized data that contribute to the program's memory image.

.debug

This section holds information for symbolic debugging. The contents are unspecified. All section names with the prefix .debug are reserved for future use in the ABI.

.dynamic

This section holds dynamic linking information. The section's attributes will include the SHF_ALLOC bit. Whether the SHF_WRITE bit is set is processor specific. See Chapter 5 for more information.

.dynstr

This section holds strings needed for dynamic linking, most commonly the strings that represent the names associated with symbol table entries. See Chapter 5 for more information.

.dynsym

This section holds the dynamic linking symbol table, as described in `Symbol Table'. See Chapter 5 for more information.

.fini

This section holds executable instructions that contribute to the process termination code. That is, when a program exits normally, the system arranges to execute the code in this section.

.fini_array

This section holds an array of function pointers that contributes to a single termination array for the executable or shared object containing the section.

.got

This section holds the global offset table. See `Coding Examples' in Chapter 3, `Special Sections' in Chapter 4, and `Global Offset Table' in Chapter 5 of the processor supplement for more information.

.hash

This section holds a symbol hash table. See `Hash Table' in Chapter 5 for more information.

.init

This section holds executable instructions that contribute to the process initialization code. When a program starts to run, the system arranges to execute the code in this section before calling the main program entry point (called main for C programs)

.init_array

This section holds an array of function pointers that contributes to a single initialization array for the executable or shared object containing the section.

.interp

This section holds the path name of a program interpreter. If the file has a loadable segment that includes relocation, the sections' attributes will include the SHF_ALLOC bit; otherwise, that bit will be off. See Chapter 5 for more information.

.line

This section holds line number information for symbolic debugging, which describes the correspondence between the source program and the machine code. The contents are unspecified.

.note

This section holds information in the format that `Note Section'. in Chapter 5 describes.

.plt

This section holds the procedure linkage table. See `Special Sections' in Chapter 4 and `Procedure Linkage Table' in Chapter 5 of the processor supplement for more information.

.preinit_array

This section holds an array of function pointers that contributes to a single pre-initialization array for the executable or shared object containing the section.

.rel.bss

This section holds relocation information, as described in `Relocation'. These relocations are applied to the .bss section.

.rel.data

This section holds relocation information, as described in `Relocation'. These relocations are applied to the .data section.

.rel.got

This section holds relocation information, as described in `Relocation'. These relocations are applied to the .got section.

.rel.plt

This section holds relocation information, as described in `Relocation'. These relocations are applied to the .plt section.

.rel.text

This section holds relocation information, as described in `Relocation'. These relocations are applied to the .text section.

.rodata

This section holds read-only data that typically contribute to a non-writable segment in the process image. See `Program Header' in Chapter 5 for more information.

.rodata1

This section hold sread-only data that typically contribute to a non-writable segment in the process image. See `Program Header' in Chapter 5 for more information.

.shstrtab

This section holds section names.

.strtab

This section holds strings, most commonly the strings that represent the names associated with symbol table entries. If the file has a loadable segment that includes the symbol string table, the section's attributes will include the SHF_ALLOC bit; otherwi

.symtab

This section holds a symbol table, as `Symbol Table'. in this chapter describes. If the file has a loadable segment that includes the symbol table, the section's attributes will include the SHF_ALLOC bit; otherwise, that bit will be off.

.text

This section holds the `text,' or executable instructions, of a program.