Relocatable and Executable File Organization

The following two tables show the organization of both types of ELF files, relocatable object files and the executable files:
Relocatable File

Executable File
ELF header

ELF header
Program header table optional

Program header table
Section 1

Segment 1
. . .

Section n

Segment 2
. . .

. . .

. . .
Section header table

Section header table optional

An ELF header resides at the beginning of an ELF object file or executable file and serves as the table of contents of the file. All other data and tables in the file may appear in any order. Sections hold the bulk of object file information for the linking view, such as instructions, data, symbol table, and relocation information.

An ELF executable file must have a program header table. A relocatable ELF file does not need one. The program header table tells the system how to load the program.

A section header table contains information describing the file's sections. Every section has an entry in the table; each entry gives information such as the section name and section size. Relocatable files to be linked must have a section header table.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.