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
Entry point
(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!
===Contemporary=== In most of today's popular programming languages and operating systems, a [[computer program]] usually only has a single ''entry point''. In [[C (programming language)|C]], [[C++]], [[D (programming language)|D]], [[Zig (programming language)|Zig]], [[Rust (programming language)|Rust]] and [[Kotlin (programming language)|Kotlin]] programs this is a [[Function (computer science)|function]] named <code>main</code>; in [[Java (programming language)|Java]] it is a [[static method]] named <code>main</code> (although the class must be specified at the invocation time), and in [[C Sharp (programming language)|C#]] it is a static method named <code>Main</code>.<ref>{{cite web |url=https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.cbclx01/mainf.htm |title=The main() function |publisher=[[IBM]] |work=ibm.com |access-date=2014-05-08 |archive-date=2017-09-10 |archive-url=https://web.archive.org/web/20170910083002/https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.cbclx01/mainf.htm |url-status=live }}</ref><ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/acy3edy3.aspx |title=Main() and Command-Line Arguments (C# Programming Guide) |publisher=Msdn.microsoft.com |access-date=2014-05-08 |archive-date=2014-06-09 |archive-url=https://web.archive.org/web/20140609000508/http://msdn.microsoft.com/en-us/library/acy3edy3.aspx |url-status=live }}</ref> In many major operating systems, the standard executable format has a single entry point. In the [[Executable and Linkable Format]] (ELF), used in [[Unix]] and [[Unix-like]] systems such as [[Linux]], the entry point is specified in the <code>e_entry</code> field of the ELF header. In the [[GNU Compiler Collection]] (gcc), the entry point used by the linker is the <code>_start</code> symbol. Similarly, in the [[Portable Executable]] format, used in [[Microsoft Windows]], the entry point is specified by the <code>AddressOfEntryPoint</code> field, which is inherited from [[COFF]]. In [[COM file]]s, the entry point is at the fixed [[offset (computer science)|offset]] of 0100h. One exception to the single-entry-point paradigm is [[Android (operating system)|Android]]. Android applications do not have a single entry point{{snd}} there is no special <code>main</code> function. Instead, they have ''essential components'' (activities and services) which the system can load and run as needed.<ref>{{cite web |url=http://www.linuxtopia.org/online_books/android/devguide/guide/topics/fundamentals.html |title=Application Fundamentals |work=Android Development |access-date=2014-02-19 |publisher=linuxtopia.org |archive-date=2013-12-31 |archive-url=https://web.archive.org/web/20131231125154/http://www.linuxtopia.org/online_books/android/devguide/guide/topics/fundamentals.html |url-status=live }}</ref> An occasionally used technique is the [[fat binary]], which consists of several executables for different targets packaged in a single file. Most commonly, this is implemented by a single overall entry point, which is compatible with all targets and branches to the target-specific entry point. Alternative techniques include storing separate executables in separate [[fork (file system)|forks]], each with its own entry point, which is then selected by the operating system.
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)