Executable

Short description: A file that causes a computer to follow indicated instructions

Program execution

General concepts

* Code
* Translation
* Compiler
* Compile-time
* Optimizing compiler
* Intermediate representation (IR)
* Execution
* Runtime system
* Runtime
* Executable
* Interpreter
* Virtual machine

Types of code

* Source code
* Object code
* Bytecode
* Machine code
* Microcode

Compilation strategies

* Just-in-time (JIT)
* Tracing just-in-time
* Ahead-of-time (AOT)
* Transcompilation
* Recompilation

Notable runtimes

* Android Runtime (ART)
* Common Language Runtime (CLR) & Mono
* crt0
* HHVM
* Java virtual machine (JVM)
* Objective-C
* V8
* Node.js
* PyPy
* Zend Engine

Notable compilers & toolchains

* GNU Compiler Collection (GCC)
* LLVM
* Clang

* v
* t
* e

A hex dump of an executable real mode loader. The first column consists of addresses of the first byte in the second column, which comprises bytes of data in hexadecimal notation (least significant byte first), and the last column consists of the corresponding ASCII form.[1]

In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instructions",[2] as opposed to a data file that must be interpreted (parsed) by a program to be meaningful.[3]

The exact interpretation depends upon the use. "Instructions" is traditionally taken to mean machine code instructions for a physical CPU.[4] In some contexts, a file containing scripting instructions (such as bytecode) may also be considered executable.

## Contents

* 1 Generation of executable files
* 2 Execution
* 3 See also
* 4 References
* 5 External links

## Generation of executable files

Executable files can be hand-coded in machine language, although it is far more convenient to develop software as source code in a high-level language that can be easily understood by humans. In some cases, source code might be specified in assembly language instead, which remains human-readable while being closely associated with machine code instructions.

The high-level language is compiled into either an executable machine code file or a non-executable machine code – object file of some sort; the equivalent process on assembly language source code is called assembly. Several object files are linked to create the executable. Object files -- executable or not -- are typically stored in a container format, such as Executable and Linkable Format (ELF) or Portable Executable (PE) which is operating system-specific.[5] This gives structure to the generated machine code, for example dividing it into sections such as .text (executable code), .data (initialized global and static variables), and .rodata (read-only data, such as constants and strings).

Executable files typically also include a runtime system, which implements runtime language features (such as task scheduling, exception handling, calling static constructors and destructors, etc.) and interactions with the operating system, notably passing arguments, environment, and returning an exit status, together with other startup and shutdown features such as releasing resources like file handles. For C, this is done by linking in the crt0 object, which contains the actual entry point and does setup and shutdown by calling the runtime library.[6]

Executable files thus normally contain significant additional machine code beyond that directly generated from the specific source code. In some cases, it is desirable to omit this, for example for embedded systems development, or simply to understand how compilation, linking, and loading work. In C, this can be done by omitting the usual runtime, and instead explicitly specifying a linker script, which generates the entry point and handles startup and shutdown, such as calling `main` to start and returning exit status to the kernel at the end.[7]

## Execution

In order to be executed by the system (such as an operating system, firmware[citation needed], or boot loader), an executable file must conform to the system's application binary interface (ABI). In simple interfaces, a file is executed by loading it into memory and jumping to the start of the address space and executing from there.[8] In more complicated interfaces, executable files have additional metadata specifying a separate entry point. For example, in ELF, the entry point is defined in the header's `e_entry` field, which specifies the (virtual) memory address at which to start execution.[9] In the GNU Compiler Collection, this field is set by the linker based on the `_start` symbol.[10]

## See also

* Comparison of executable file formats
* Executable compression
* Executable text

## References

1. ↑ Celovi, Paul (2002). Embedded FreeBSD Cookbook. Elsevier. pp. 108, 187–188. ISBN 1-5899-5004-6. https://books.google.com/books?id=E4SFkfsOVaoC&pg=PA188. Retrieved 2022-03-06.
2. ↑ "executable". Merriam-Webster's Online Dictionary. Merriam-Webster. http://www.merriam-webster.com/dictionary/executable.
3. ↑ Mueller, John Paul (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. John Wiley & Sons. p. 24. ISBN 978-0-470-04616-6. https://books.google.com/books?id=Ua819DVKQPwC&pg=PA24. Retrieved 2023-03-06.
4. ↑ "Machine Instructions" (in en-US). 2015-11-03. https://www.geeksforgeeks.org/machine-instructions/.
5. ↑ "Chapter 4: Object Files". https://refspecs.linuxbase.org/elf/gabi4+/ch4.intro.html.
6. ↑ "List of Executable File Extensions" (in en). https://www.lifewire.com/list-of-executable-file-extensions-2626061.
7. ↑ "Hello from a libc-free world! (Part 1)". 2010-03-16. https://blogs.oracle.com/ksplice/entry/hello_from_a_libc_free.
8. ↑ Smith, James E.; Nair, Ravi (2005-05-16). "The Architecture of Virtual Machines". Computer 38 (5): 33–34. doi:10.1109/MC.2005.173.
9. ↑ Rusling, David A. (1999). "Chapter 4 – Processes". The Linux Kernel. sec. 4.8.1 – ELF. https://tldp.org/LDP/tlk/kernel/processes.html. Retrieved 2023-03-06.
10. ↑ Page, Daniel (2009). A Practical Introduction to Computer Architecture. Springer Science+Business Media. pp. 415–416. ISBN 978-1-84882-255-9. https://books.google.com/books?id=XH4sIpY1D70C&pg=PA415. Retrieved 2023-03-06.

## External links

* EXE File Format at What Is

* v
* t
* e

Executable and object file formats

* a.out
* AIF
* COFF
* CMD
* COM
* ECOFF
* ELF
* GOFF
* Hunk
* Mach-O
* MZ
* NE
* OMF
* OS/360
* PE
* PEF
* XCOFF

* Comparison of formats
* .exe

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Executable. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Executable&oldid=241101"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template