The four main ELF object-file types are executable (ET_EXEC), shared object (ET_DYN), relocatable (ET_REL), and core (ET_CORE). Here, “groups” means file types—not four fixed parts inside every ELF file.
The four ELF object-file types
ELF, the Executable and Linkable Format, identifies an object’s type in its ELF header. NetBSD’s ELF manual lists four main types, each serving a different role in a program’s lifecycle:
| Type | ELF value | Purpose |
|---|---|---|
| Relocatable object | ET_REL |
Provides information a linker can use to produce an executable or shared library. |
| Shared object | ET_DYN |
Provides information for a linker during linking or for a dynamic loader at runtime. |
| Executable | ET_EXEC |
Is suitable for execution and contains information used to create a new process image. |
| Core file | ET_CORE |
Describes a process’s virtual address space and register state; it is typically used with a debugger. |
The type names and their corresponding e_type values are documented in the NetBSD manual and the ELF header type definitions.
How to distinguish file types from ELF structure
The four types describe what role an ELF file plays. They are not four components that every file contains. ELF files are organized with an ELF header and may also have program-header and section-header tables; which tables are present can depend on the file type.
#1 Best Overall
Sections and segments are two different views of an ELF file. Sections, described by section headers, organize information used for linking, such as instructions, data, symbols, and relocation information. Segments, described by program headers, tell the system loader what information is relevant when preparing a process image. The NetBSD Project puts it succinctly: “ELF files have a dual nature.” See the NetBSD ELF manual and the System V ELF specification.
In short, the type answers what the file is for; sections and segments describe its contents from the linking and execution perspectives.
Quick Recap
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.




