SPARC Assembly Language Reference Manual

Exit Print View

Updated: July 2014
 
 

2.1 Sections

A section is the smallest unit of an object that can be relocated. Use the elfdump(1) command to inspect the components of an object or executable file generated by the assembler.

The following sections are commonly present in an ELF file:

  • Section header

  • Executable text

  • Read-only data

  • Read-write data

  • Read-write uninitialized data (section header only)

Sections do not need to be specified in any particular order. The current section is the section to which code is generated.

These sections contain all other information in an object file and satisfy several conditions.

  1. Every section must have one section header describing the section. However, a section header does not need to be followed by a section.

  2. Each section occupies one contiguous sequence of bytes within a file. The section may be empty (that is, of zero-length).

  3. A byte in a file can reside in only one section. Sections in a file cannot overlap.

  4. An object file may have inactive space. The contents of the data in the inactive space are unspecified.

Sections can be added for multiple text or data segments, shared data, user-defined sections, or information in the object file for debugging.


Note - Not all of the component sections need to be present.