19.2. Executable Formats

The official Linux executable format is named ELF (Executable and Linking Format): it was developed by Unix System Laboratories and is quite popular 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 a.out (Assembler OUTput Format); actually, there were several versions of that format floating around the Unix world. It is little used nowadays, since 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 like MS-DOS EXE programs, or Unix BSD's COFF executables. A few executable formats, like Java or bash scripts, are platform-independent.

An executable format is described by an object of type linux_binfmt, which essentially provide 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

Used to dynamically bind 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 Section 9.1.1 in Chapter 9).

All ...

Get Understanding the Linux Kernel 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.