3.2. Sections

Object files (and entire programs) are commonly divided into multiple segments or sections. Often these divisions are made based on what the data will be used for during execution of the program: code and various types of data. To save disk space, many object formats offer a special section that reserves memory space for data but does not actually store any data in the object file: UNIX systems usually refer to this section as the “.bss” section. An object file typically has many sections of various types, and may include special sections for debugging and symbol information.

In yasm, each section (or segment) described in the input file is stored into a section structure. The most important data kept in the section structure is a linked list of bytecodes describing the section’s contents. Other per-section data is also stored, including: