Executable Formats

The standard Linux executable format is named Executable and Linking Format ( ELF). It was developed by Unix System Laboratories and is now the most widely used format in the Unix world. Several well-known Unix operating systems, such as System V Release 4 and Sun’s Solaris 2, have adopted ELF as their main executable format.

Older Linux versions supported another format named Assembler OUTput Format(a.out); actually, there were several versions of that format floating around the Unix world. It is seldom used now, because ELF is much more practical.

Linux supports many other different formats for executable files; in this way, it can run programs compiled for other operating systems, such as MS-DOS EXE programs or BSD Unix’s COFF executables. A few executable formats, such as Java or bash scripts, are platform-independent.

An executable format is described by an object of type linux_binfmt, which essentially provides three methods:

load_binary

Sets up a new execution environment for the current process by reading the information stored in an executable file.

load_shlib

Dynamically binds a shared library to an already running process; it is activated by the uselib( ) system call.

core_dump

Stores the execution context of the current process in a file named core. This file, whose format depends on the type of executable of the program being executed, is usually created when a process receives a signal whose default action is “dump” (see the section "Actions Performed ...

Get Understanding the Linux Kernel, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.