Everipedia Logo
Everipedia is now IQ.wiki - Join the IQ Brainlist and our Discord for early access to editing on the new platform and to participate in the beta testing.
Executable

Executable

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

The exact interpretation depends upon the use."Instructions" is traditionally taken to mean machine code instructions for a physical CPU,[2] in some contexts a file containing bytecode or scripting language instructions may also be considered executable.

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 in a container format, such as Executable and Linkable Format (ELF).[3] This structures the generated machine code, for example dividing it into sections such as the .text (executable code), .data (static variables), and .rodata (static constants).

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

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.[5]

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 kernel at end.[6]

See also

  • Comparison of executable file formats

References

[1]
Citation Linkwww.merriam-webster.com"executable". Merriam-Webster's Online Dictionary. Merriam-Webster. Retrieved 2008-07-19.
Sep 26, 2019, 2:48 PM
[2]
Citation Linkwww.geeksforgeeks.org"Machine Instructions". GeeksforGeeks. 2015-11-03. Retrieved 2019-09-18.
Sep 26, 2019, 2:48 PM
[3]
Citation Linkrefspecs.linuxbase.org"Chapter 4: Object Files". refspecs.linuxbase.org. Retrieved 2019-09-18.
Sep 26, 2019, 2:48 PM
[4]
Citation Linklinux-audit.comBoelen, Michael (2019-05-15). "The 101 of ELF files on Linux: Understanding and Analysis - Linux..." Linux Audit. Retrieved 2019-09-18.
Sep 26, 2019, 2:48 PM
[5]
Citation Linkwww.lifewire.comcontent, Tim Fisher Tim Fisher has 30+ years' professional technology support experience He writes troubleshooting; Lifewire, is the General Manager of. "List of Executable File Extensions". Lifewire. Retrieved 2019-09-18.
Sep 26, 2019, 2:48 PM
[6]
Citation Linkblogs.oracle.comMcKellar, Jessica (Mar 16, 2010). "Hello from a libc-free world! (Part 1)".
Sep 26, 2019, 2:48 PM
[7]
Citation Linkwhatis.techtarget.comEXE File Format
Sep 26, 2019, 2:48 PM
[8]
Citation Linkwww.merriam-webster.com"executable"
Sep 26, 2019, 2:48 PM
[9]
Citation Linkwww.geeksforgeeks.org"Machine Instructions"
Sep 26, 2019, 2:48 PM
[10]
Citation Linkrefspecs.linuxbase.org"Chapter 4: Object Files"
Sep 26, 2019, 2:48 PM
[11]
Citation Linklinux-audit.com"The 101 of ELF files on Linux: Understanding and Analysis - Linux..."
Sep 26, 2019, 2:48 PM
[12]
Citation Linkwww.lifewire.com"List of Executable File Extensions"
Sep 26, 2019, 2:48 PM
[13]
Citation Linkblogs.oracle.com"Hello from a libc-free world! (Part 1)"
Sep 26, 2019, 2:48 PM
[14]
Citation Linkwhatis.techtarget.comEXE File Format
Sep 26, 2019, 2:48 PM
[15]
Citation Linken.wikipedia.orgThe original version of this page is from Wikipedia, you can edit the page right here on Everipedia.Text is available under the Creative Commons Attribution-ShareAlike License.Additional terms may apply.See everipedia.org/everipedia-termsfor further details.Images/media credited individually (click the icon for details).
Sep 26, 2019, 2:48 PM