Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Executable
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|File that causes a computer to follow indicated instructions}} {{About|a general type of computer file|the specific file type used in some operating systems|.exe}} {{Use dmy dates|date=December 2021|cs1-dates=y}} {{Use list-defined references|date=December 2021}} {{Program execution}} [[File:Binary executable file2.png|thumb|A [[hex dump]] of an executable [[real mode]] loader. The first column consists of [[byte address|address]]es of the first byte in the second column, which comprises bytes of data in [[hexadecimal]] notation ([[Bit numbering#Bit significance and indexing|least significant byte]] first), and the last column consists of the corresponding [[ASCII]] form.<ref name="Celovi_2022"/>]] In [[computer science]], '''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 [[instruction (computer science)|instruction]]s",<ref name="MW_2008"/> as opposed to a [[data (computing)|data file]] that must be interpreted ([[parser|parsed]]) by an [[interpreter (computing)|interpreter]] to be functional.<ref name="Mueller_2007" /> The exact interpretation depends upon the use. "Instructions" is traditionally taken to mean [[machine code]] instructions for a physical [[central processing unit|CPU]].<ref name="GFG_2015"/> In some contexts, a file containing scripting instructions (such as [[bytecode]]) may also be considered executable. ==Generation of executable files== {{See also|Object file}} 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 [[Compiler|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 [[linker (computing)|linked]] to create the executable. Object files—executable or not—are typically stored in a [[digital container format|container format]], such as [[Executable and Linkable Format]] (ELF) or [[Portable Executable]] (PE) which is [[operating system]]-specific.<ref name="LB_2019"/> 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 handle]]s. 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]].<ref name="Fisher_2019"/> 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 <code>main</code> to start and returning exit status to the kernel at the end.<ref name="McKellar_2010"/> == Execution == In order to be executed by the system (such as an [[operating system]], {{citation needed span|[[firmware]]|date=March 2023}}, 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.<ref name="Computer_2005"/> 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 <code>e_entry</code> field, which specifies the (virtual) memory address at which to start execution.<ref name="Rusling_1999"/> In the [[GNU Compiler Collection]], this field is set by the linker based on the <code>_start</code> symbol.<ref name="Page_2009"/> ==See also== * [[Comparison of executable file formats]] * [[Executable compression]] * [[Executable text]] ==References== {{reflist|refs= <ref name="Celovi_2022">{{cite book|url=https://books.google.com/books?id=E4SFkfsOVaoC&pg=PA188|title=Embedded FreeBSD Cookbook|last=Celovi|first=Paul|publisher=[[Elsevier]]|date=2002|access-date=2022-03-06|pages=108, 187–188|isbn=1-5899-5004-6}}</ref> <ref name="Computer_2005">{{cite journal|title=The Architecture of Virtual Machines|last1=Smith|first1=James E.|author1-link=James E. Smith (engineer)|last2=Nair|first2=Ravi|journal=[[Computer (magazine)|Computer]]|date=2005-05-16|volume=38|issue=5|pages=33–34|doi=10.1109/MC.2005.173|url=http://digital.library.wisc.edu/1793/11154 }}</ref> <ref name="Fisher_2019">{{cite web |url=https://www.lifewire.com/list-of-executable-file-extensions-2626061 |title=List of Executable File Extensions |author-last=Fisher |author-first=Tim |website=lifewire.com |language=en |access-date=2019-09-18}}</ref> <ref name="GFG_2015">{{cite web |url=https://www.geeksforgeeks.org/machine-instructions/ |title=Machine Instructions |date=2015-11-03 |website=GeeksforGeeks |language=en-US |access-date=2019-09-18}}</ref> <ref name="LB_2019">{{cite web |url=https://refspecs.linuxbase.org/elf/gabi4+/ch4.intro.html |title=Chapter 4: Object Files |website=refspecs.linuxbase.org |access-date=2019-09-18}}</ref> <ref name="McKellar_2010">{{cite web |url=https://blogs.oracle.com/ksplice/entry/hello_from_a_libc_free |title=Hello from a libc-free world! (Part 1) |date=2010-03-16 |author-first=Jessica |author-last=McKellar}}</ref> <ref name="Mueller_2007">{{cite book|url=https://books.google.com/books?id=Ua819DVKQPwC&pg=PA24|title=Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000|last=Mueller|first=John Paul|publisher=[[John Wiley & Sons]]|date=2007|access-date=2023-03-06|page=24|isbn=978-0-470-04616-6}}</ref> <ref name="MW_2008">{{cite web |url=http://www.merriam-webster.com/dictionary/executable |title=executable |access-date=2008-07-19 |work=Merriam-Webster's Online Dictionary |publisher=[[Merriam-Webster]]}}</ref> <ref name="Page_2009">{{cite book|url=https://books.google.com/books?id=XH4sIpY1D70C&pg=PA415|title=A Practical Introduction to Computer Architecture|last=Page|first=Daniel|publisher=[[Springer Science+Business Media]]|date=2009|access-date=2023-03-06|pages=415–416|isbn=978-1-84882-255-9}}</ref> <ref name="Rusling_1999">{{cite book|chapter-url=https://tldp.org/LDP/tlk/kernel/processes.html|chapter=Chapter 4 – Processes|title=The Linux Kernel|last=Rusling|first=David A.|date=1999|access-date=2023-03-06|at=sec. 4.8.1 – ELF}}</ref> }} ==External links== * [http://whatis.techtarget.com/fileformat/EXE-Executable-file-program EXE File Format] at What Is {{Executables}} [[Category:Computer file systems]] [[Category:Programming language implementation]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Citation needed span
(
edit
)
Template:Executables
(
edit
)
Template:Program execution
(
edit
)
Template:Reflist
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Use list-defined references
(
edit
)