Linker and Libraries Guide

Special Sections

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

Table 7-17 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"

.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

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 comment information, typically contributed by the components of the compilation system. This section can be manipulated by mcs(1)).

.data, .data1

These sections hold initialized data that contribute to the program's memory image.

.dynamic

This section holds dynamic linking information. See "Dynamic Section" for details.

.dynstr

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

.dynsym

This section holds the dynamic linking symbol table. See "Symbol Table" for details.

.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. See "Initialization and Termination Routines" for details.

.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. See "Initialization and Termination Routines" for details.

.got

This section holds the global offset table. See "Global Offset Table (Processor-Specific)" for more information.

.hash

This section holds a symbol hash table. See "Hash Table" for more information.

.init

This section holds executable instructions that contribute to the process initialization code. That is, when a program starts to run, the system arranges to execute the code in this section before calling the program entry point. See "Initialization and Termination Routines" for details.

.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. See "Initialization and Termination Routines" for details.

.interp

This section holds the pathname of a program interpreter. See "Program Interpreter" for more information.

.note

This section holds information in the format described in "Note Section".

.plt

This section holds the procedure linkage table. See "Procedure Linkage Table (Processor-Specific)" 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. See "Initialization and Termination Routines" for details.

.rela

This section holds relocations that do not apply to a particular section. One use of this is for register relocations, see "Register Symbols" for more details.

.relname, .relaname

These sections hold relocation information, as "Relocation" describes. 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. 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

These sections hold read-only data that typically contribute to a non-writable segment in the process image. See "Program Header" 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; otherwise, that bit will be turned off.

.symtab

This section holds a symbol table, as "Symbol Table" 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 turned off.

.text

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

.SUNW_bss

This section holds 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

This section holds the heap of a dynamic executable created from dldump(3DL).

.SUNW_move

This section holds the additional information for partially initialized data. See "Move Section".

.SUNW_reloc

This section holds 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

This section holds additional symbol table information. See "Syminfo Table" for more information.

.SUNW_version

Sections of this name hold versioning information. See "Versioning Information" for more 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 lets one 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.

Preexisting Extensions:

.conflict

.liblist

.lit8

.sdata

.debug

.line

.reginfo

.stab

.gptab

.lit4

.sbss

.tdesc