Executable

From Wikipedia, the free encyclopedia

A Hexdump of a binary executable file
A Hexdump of a binary executable file

An executable or executable file, in computer science, is a file whose contents are meant to be treated as a program by a computer.

While a file in source form may be executable, such a file is usually referred to as a "script." Most executable files contain the binary representation of machine instructions of a specific processor (in which case the executable may also be referred to as a binary), or they may be binary pseudocode for a virtual machine. A non-source executable file is also called an object program. Some operating systems designate executable files by specific naming convention (such as the name ending in a filename extension ".bin" or ".exe") or noted alongside the file in its metadata (such as the "execute" permission bits under Unix-like operating systems). However, unless a file contains properly-formatted computer instructions, it will not actually execute properly even if it is so marked.

An executable file can contain much information that is not part of the program itself, such as information on the environment required to run the program, debugging and symbolic information, or other housekeeping information used by the operating system to prepare the program to be run. Such information is frequently not part of executables for embedded systems or systems where storage is small. Debugging information is not generally provided with executables for commercial software packages.

[edit] System calls

Executables contain calls to operating system services in addition to regular machine instructions. This means that executables are usually operating system-specific in addition to being processor-specific.

[edit] Formats

COM (.com) (DOS)
PE (.exe, .dll, .ocx, .sys, .scr) (Windows)
ELF (Unix and Unix-like)
Mach-O (Mac)
Hunk (AmigaOS)
For a list of more executable formats, see the lists at object file.

[edit] Scripts

Main article: Scripting languages

Not all applications exist in a form readable only by machines. Related, but generally mutually incompatible, are Scripting languages. Unlike binaries, these applications do not go through a compilation step before being delivered to an end user. They are generally human-readable. In a sense, a script exists as both the source code and the "binary" at the same time.