next up previous contents
Next: The Section Header Table Up: The ELF File Format Previous: The ELF Header

The Program Header Table

Program headers are only important in executable and shared object files. The program header table is an array of entries where each entry is a structure describing a segment in the object file or other information needed to create an executable process image. The size of an entry in the table and the number of entries in the table are given in the ELF header (See Figure 2.6). Each entry in the program header table (see Figure 2.7) contains the type, file offset, physical address, virtual address, file size, memory image size, and alignment for a segment in the program. The program header is crucial to creating a process image for the object file. The operating system copies the segment (if it is loadable, i.e., if p_type is PT_LOAD) into memory according to the location and size information. The p_type field is shown in Figure 2.7 as the first item in the struct.

  
Figure: The Section Header
\begin{figure}
\begin{tex2html_preform}\begin{verbatim}
typedef struct {
Elf...
..._Shdr;\end{verbatim}\end{tex2html_preform}
\rule{6.5in}{0.3mm}
\end{figure}



Michael L. Haungs
1998-09-21