Linker and Libraries Guide

Special Sections

Various sections hold program and control information. Sections in the following table are used by the system and have the indicated types and attributes.

Table 7-17 ELF Special Sections

Name 

Type 

Attribute 

.bss

SHT_NOBITS

SHF_ALLOC + SHF_WRITE

.comment

SHT_PROGBITS

None 

.data

SHT_PROGBITS

SHF_ALLOC + SHF_WRITE

.data1

SHT_PROGBITS

SHF_ALLOC + SHF_WRITE

.dynamic

SHT_DYNAMIC

SHF_ALLOC + SHF_WRITE

.dynstr

SHT_STRTAB

SHF_ALLOC

.dynsym

SHT_DYNSYM

SHF_ALLOC

.fini

SHT_PROGBITS

SHF_ALLOC + SHF_EXECINSTR

.fini_array

SHT_FINI_ARRAY

SHF_ALLOC + SHF_WRITE

.got

SHT_PROGBITS

See “Global Offset Table (Processor-Specific)”

.hash

SHT_HASH

SHF_ALLOC

.init

SHT_PROGBITS

SHF_ALLOC + SHF_EXECINSTR

.init_array

SHT_INIT_ARRAY

SHF_ALLOC + SHF_WRITE

.interp

SHT_PROGBITS

See “Program Interpreter”

.note

SHT_NOTE

None 

.plt

SHT_PROGBITS

See “Procedure Linkage Table (Processor-Specific)”

.preinit_array

SHT_PREINIT_ARRAY

SHF_ALLOC + SHF_WRITE

.rela

SHT_RELA

None 

.relname

SHT_REL

See “Relocation”

.relaname

SHT_RELA

See “Relocation”

.rodata

SHT_PROGBITS

SHF_ALLOC

.rodata1

SHT_PROGBITS

SHF_ALLOC

.shstrtab

SHT_STRTAB

None 

.strtab

SHT_STRTAB

See description below 

.symtab

SHT_SYMTAB

See “Symbol Table”

.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

.text

SHT_PROGBITS

SHF_ALLOC + SHF_EXECINSTR

.SUNW_bss

SHT_NOBITS

SHF_ALLOC + SHF_WRITE

.SUNW_heap

SHT_PROGBITS

SHF_ALLOC + SHF_WRITE

.SUNW_move

SHT_SUNW_move

SHF_ALLOC

.SUNW_reloc

SHT_REL

SHT_RELA

SHF_ALLOC

.SUNW_syminfo

SHT_SUNW_syminfo

SHF_ALLOC

.SUNW_version

SHT_SUNW_verdef

SHT_SUNW_verneed

SHT_SUNW_versym

SHF_ALLOC

.bss

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

Comment information, typically contributed by the components of the compilation system. This section can be manipulated by mcs(1).

.data, .data1

Initialized data that contribute to the program's memory image.

.dynamic

Dynamic linking information. See “Dynamic Section” for details.

.dynstr

Strings needed for dynamic linking, most commonly the strings that represent the names associated with symbol table entries.

.dynsym

Dynamic linking symbol table. See “Symbol Table” for details.

.fini

Executable instructions that contribute to a single termination function for the executable or shared object containing the section. See “Initialization and Termination Routines” for details.

.fini_array

An array of function pointers that contribute to a single termination array for the executable or shared object containing the section. See “Initialization and Termination Routines” for details.

.got

The global offset table. See “Global Offset Table (Processor-Specific)”.

.hash

Symbol hash table. See “Hash Table”.

.init

Executable instructions that contribute to a single initialization function for the executable or shared object containing the section. See “Initialization and Termination Routines” for details.

.init_array

An array of function pointers that contributes to a single initialization array for the executable or shared object containing the section. See “Initialization and Termination Routines” for details.

.interp

The path name of a program interpreter. See “Program Interpreter”.

.note

Information in the format described in “Note Section”.

.plt

The procedure linkage table. See “Procedure Linkage Table (Processor-Specific)”.

.preinit_array

An array of function pointers that contribute to a single pre-initialization array for the executable or shared object containing the section. See “Initialization and Termination Routines” for details.

.rela

Relocations that do not apply to a particular section. One use of this section is for register relocations. See “Register Symbols”.

.relname, .relaname

Relocation information, as “Relocation” describes. If the file has a loadable segment that includes relocation, the sections' attributes include the SHF_ALLOC bit. Otherwise, that bit is off. Conventionally, name is supplied by the section to which the relocations apply. Thus a relocation section for .text normally will have the name .rel.text or .rela.text.

.rodata, .rodata1

Read-only data that typically contribute to a non-writable segment in the process image. See “Program Header”.

.shstrtab

Section names.

.strtab

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 include the SHF_ALLOC bit. Otherwise, that bit is turned off.

.symtab

Symbol table, as “Symbol Table” describes. If the file has a loadable segment that includes the symbol table, the section's attributes include the SHF_ALLOC bit. Otherwise, that bit is turned off.

.tbss

This section holds uninitialized thread-local data that contribute to the program's memory image. By definition, the system initializes the data with zeros when the data is instantiated for each new execution flow. The section occupies no file space, as indicated by the section type, SHT_NOBITS. See “Thread-Local Storage” for more information.

.tdata, .tdata1

These sections hold initialized thread-local data that contribute to the program's memory image. A copy of its contents is instantiated by the system for each new execution flow. See “Thread-Local Storage” for more information.

.text

The text or executable instructions of a program.

.SUNW_bss

Partially initialized data for shared objects that contribute to the program's memory image. The data is initialized at runtime. The section occupies no file space, as indicated by the section type SHT_NOBITS.

.SUNW_heap

The heap of a dynamic executable created from dldump(3DL).

.SUNW_move

Additional information for partially initialized data. See “Move Section”.

.SUNW_reloc

Relocation information, as “Relocation” describes. This section is a concatenation of relocation sections that provides better locality of reference of the individual relocation records. Only the offset of the relocation record itself is meaningful, thus the section sh_info value is zero.

.SUNW_syminfo

Additional symbol table information. See “Syminfo Table”.

.SUNW_version

Versioning information. See “Versioning Information”.

Section names with a dot (.) prefix are reserved for the system, although applications can use these sections if their existing meanings are satisfactory. Applications can use names without the prefix to avoid conflicts with system sections. The object file format enables you to define sections not in the list above. An object file can have more than one section with the same name.

Section names reserved for a processor architecture are formed by placing an abbreviation of the architecture name ahead of the section name. The name should be taken from the architecture names used for e_machine. For example, .Foo.psect is the psect section defined by the FOO architecture.

Existing extensions use their historical names.