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
(section)
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!
==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"/>
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)