The ELF header is always located at the beginning of the ELF file. It describes the ELF file organization and contains the actual sizes of the object file control structures. The initial bytes of an ELF header specify how the file is to be interpreted.
The ELF header contains the following information:
entry
Virtual address at which the process is to start. A value of 0 indicates no associated entry point.
ident
Marks the file as an object file and provides machine-independent data to decode and interpret the file contents.
phnum
Number of entries in program header table. A value of 0 indicates the file has no program header table.
shentsize
Size in bytes of the section header. A section header is one entry in the section header table; all entries are the same size.
shnum
Number of entries in section header table. A value of 0 indicates the file has no section header table.
shstrndx
Section header table index of the entry associated with the section name string table. A value of SHN_UNDEF indicates the file does not have a section name string table.
type
Identifies the object file type. Table 3-1Table 3-1 describes the reserved object file types.
Table 3-1Table 3-1 shows reserved object file types:
Table 3-1
Type |
Value |
Description |
---|---|---|
none |
0 |
No file type |
rel |
1 |
Relocatable file |
exec |
2 |
Executable file |
dyn |
3 |
Shared object file |
core |
4 |
Core file |
loproc |
0xff00 |
Processor-specific |
hiproc |
0xffff |
Processor-specific |