SPARC Assembly Language Reference Manual

Exit Print View

Updated: July 2014
 
 

2.1.1 Section Header

The section header allows you to locate all of the file sections. An entry in a section header table contains information characterizing the data in a section.

The section header contains a number of fields as described in detail in sys/elf.h and Sections in Oracle Solaris 11.2 Linkers and Libraries Guide . However, only the following fields are of immediate interest to the assembly language programmer because they can be specified in assembler pseudo-operations (directives):

sh_flags

Description: One-bit descriptions of section attributes. Table 2–1 describes the some of the section attribute flags. For details and additional flags, see Sections in Oracle Solaris 11.2 Linkers and Libraries Guide

sh_info

Description: Extra information. The interpretation of this information depends on the section type, as described in . Table 2–2

sh_link

Description: Section header table index link. The interpretation of this information depends on the section type, as described in . Table 2–2

sh_name

Description: Specifies the section name. An index into the section header string table section specifies the location of a null-terminated string.

Table 2-1  Section Attribute Flags
Flag
Default Value
Description
SHF_WRITE
0x1
Contains data that is writable during process execution.
SHF_ALLOC
0x2
Occupies memory during process execution. This attribute is off if a control section does not reside in the memory image of the object file.
SHF_EXECINSTR
0x4
Contains executable machine instructions.
SHF_MASKPROC
0xf0000000
Reserved for processor-specific semantics.
Table 2-2  Section Types Modified by Assembler Pseudo-ops
Name
Value
Description
null
0
Marks section header as inactive.
progbits
1
Contains information defined explicitly by the program.
note
7
Contains information that marks the file.
nobits
8
Contains information defined explicitly by the program; however, a section of this type does not occupy any space in the file.