Comparison of executable file formats: Difference between revisions

Content deleted Content added
Added/corrected references for BeOS/Haiku
The processor declarations are by file, but multiple files can be combined into a multi-architecture binary, with different encapsulated files having different processor declarations (fat binary).
 
(29 intermediate revisions by 23 users not shown)
Line 1:
{{Short description|none}} <!-- This short description is INTENTIONALLY "none" - please see WP:SDNONE before you consider changing it! -->
{{Use dmy dates|date=December 2014}}
This is a comparison of binary [[executable]] [[file format]]s which, once loaded by a suitable executable [[Loader (computing)|loader]], can be directly executed by the CPU rather than becomebeing interpreted by software. In addition to the binary application code, the executables may contain headers and tables with relocation and fixup information as well as various kinds of meta data. Among those formats listed, the ones in most common use are [[Portable Executable|PE]] (on [[Microsoft Windows]]), [[Executable and Linkable Format|ELF]] (on [[Linux]] and most other versions of [[Unix]]), [[Mach-O]] (on [[macOS]] and [[iOS]]) and [[DOS MZ executable|MZ]] (on [[DOS]]).
 
{{sticky header}}
{| class="wikitable sortable"
{{sort-under}}
{| class="wikitable sortable sort-under sticky-header"
|-
! scope="col" | Format name
Line 11 ⟶ 14:
! scope="col" | [[Metadata]]{{efn|name=metadata}}
! scope="col" | [[Code signing|Digital signature]]
! scope="col" | [[String (computer science)|String table]] table
! scope="col" | [[Symbol table]]
! scope="col" | [[64-bit]]
! scope="col" | [[Fat binary|Fat binaries]]
! scope="col" | Can contain [[Icon (computing)|icon]]
|-
! scope="row" | [[Executable and Linkable Format|ELF]]
| [[Unix-like]], [[OpenVMS]], [[BeOS]] <small>from R4 onwards</small>, [[Haiku_(operating_system)|Haiku]], [[SerenityOS]]
| style="text-align: center;" | none
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{some|Extension<ref>{{cite web|url=http://freshmeat.net/projects/elfsign/ |title=elfsign – Freecode |publisher=Freshmeat.net |access-date=9 July 2012}}</ref>}}
| {{Yes}}
| {{Yes}}<ref name=3elf>{{cite web|url=http://uw714doc.sco.com/en/man/html.3elf/elf_getarsym.3elf.html |title=(3elf) - Elf library routines |publisher=Uw714doc.sco.com |date=25 April 2004 |access-date=9 July 2012}}</ref>
| {{Yes}}
| {{some|Extension<ref name=fatelf>{{cite web|url=http://icculus.org/fatelf/ |title=FatELF: Universal Binaries for Linux |publisher=Icculus.org |access-date=9 July 2012}}</ref>}}
| {{some|Extension<ref name=elficon>{{cite web|url=http://www.compholio.com/elfres/ |title=ElfIcon: Icons for ELF files |publisher=Compholio.com |access-date=9 July 2012}}</ref>}}
|-
! scope="row" | [[Portable Executable|PE]]
| [[Windows]], [[ReactOS]], [[HX&nbsp;DOS&nbsp;Extender]], [[BeOS]] <small>(R3 only)</small>
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{Yes}}<ref>{{cite web|url=http://www.microsoft.com/whdc/winlogo/drvsign/Authenticode_PE.mspx |title=Windows Authenticode Portable Executable Signature Format |publisher=Microsoft |date=29 August 2008 |access-date=9 July 2012}}</ref>
| {{Yes}}
| {{Yes}}
| {{No}}
| {{some|Only [[DOS MZ executable|MZ (DOS)]]<ref>[[Portable_Executable#History|History of Portable Executable]]</ref>}}
| {{Yes}}
|-
! scope="row" | [[Portable Executable|PE32+]]
| [[Windows]] <small>(64-bit editions only)</small>
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{some|"Compiled Hybrid Portable Executable"}}
| {{Yes}}
|-
! scope="row" | [[Mach-O]]<ref name=macosx>{{cite web|url=https://developer.apple.com/library/mac/documentation/developertools/conceptual/MachORuntime/Reference/reference.html |title=OS X ABI Mach-O File Format Reference |publisher=Apple Inc. |date=2009-02-04 |url-status=dead |archive-url=https://web.archive.org/web/20140904004108/https://developer.apple.com/library/mac/documentation/developertools/conceptual/MachORuntime/Reference/reference.html |archive-date=September 4, 2014}}</ref>
| [[NeXTSTEP]], [[macOS]], [[iOS]], [[iPadOS]], [[watchOS]], [[tvOS]], [[visionOS]]
| style="text-align: center;" | none
| {{Yes}} by file or subfile of a [[Fat binary#NeXT's/Apple's multi-architecture binaries|multi-architecture binary]]
| {{Some}} <small>(limited to max. 256 sections)</small>
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}} ([[Fat binary#NeXT's/Apple's multi-architecture binaries|multi-architecture binary]])
| {{No}}
|-
! scope="row" | [[OS/360 Object File Format|OS/360]]
| [[OS/360 and successors]], and [[VS/9]], mainframe operating systems
| style="text-align: center;" | none
| {{No}}
Line 25 ⟶ 80:
| {{No}}
| {{No}}
| {{Yes}}
| {{Yes}}
| {{No}}
| {{No}}
|-
! scope="row" | [[GOFF]]
| IBM [[MVS]] and [[z/OS]] mainframe operating systems
| style="text-align: center;" | none
| {{No}}
| {{No}}
| {{Yes}}
| {{No}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
Line 37 ⟶ 105:
| {{No}}
| {{No}}
| {{Yes}}<ref name=aout>{{cite web|url=http://www.freebsd.org/cgi/man.cgi?query=a.out&sektion=5 |title=a.out(5) - FreeBSD Man Pages |publisher=Freebsd.org |date=10 June 2010 |accessdateaccess-date=9 July 2012}}</ref>
| {{Yes}}<ref name=aout />
| {{Some|Extension}}
Line 80 ⟶ 148:
| {{Yes}}
| {{No}}
| {{No}}
|-
! scope="row" | [[Executable and Linkable Format|ELF]]
| [[Unix-like]], [[OpenVMS]], [[BeOS]] <small>from R4 onwards</small>, [[Haiku_(operating_system)|Haiku]]
| style="text-align: center;" | none
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{Yes}}<ref>{{cite web|url=http://freshmeat.net/projects/elfsign/ |title=elfsign – Freecode |publisher=Freshmeat.net |date= |accessdate=9 July 2012}}</ref>
| {{Yes}}
| {{Yes}}<ref name=3elf>{{cite web|url=http://uw714doc.sco.com/en/man/html.3elf/elf_getarsym.3elf.html |title=(3elf) - Elf library routines |publisher=Uw714doc.sco.com |date=25 April 2004 |accessdate=9 July 2012}}</ref>
| {{Yes}}
| {{some|Extension<ref name=fatelf>{{cite web|url=http://icculus.org/fatelf/ |title=FatELF: Universal Binaries for Linux |publisher=Icculus.org |date= |accessdate=9 July 2012}}</ref>}}
| {{some|Extension<ref name=elficon>{{cite web|url=http://www.compholio.com/elfres/ |title=ElfIcon: Icons for ELF files |publisher=Compholio.com |date= |accessdate=9 July 2012}}</ref>}}
|-
! scope="row" | [[Mach-O]]<ref name=macosx>{{cite web|url=https://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html#//apple_ref/doc/uid/20001298-BAJIHABI |title=Mac OS X ABI Mach-O File Format Reference |publisher=Apple Inc. |date=4 February 2009 |accessdate=9 July 2012}}</ref>
| [[NeXTSTEP]], [[macOS]], [[iOS]], [[watchOS]], [[tvOS]]
| style="text-align: center;" | none
| {{Yes}} by section
| {{Some}} <small>(limited to max. 256 sections)</small>
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{No}}
|-
Line 134 ⟶ 176:
| {{No}}
|-
! scope="row" | [[Preferred Executable Format|PEF]]<ref name="apple-pef">{{cite web|archiveurlarchive-url=https://web.archive.org/web/20080512065331/http://developer.apple.com/tools/mpw-tools/commandref/dumppef.html|title=MPW Command Reference - DumpPEF|archivedatearchive-date=12 May 2008|url=https://developer.apple.com/tools/mpw-tools/commandref/dumppef.htm|publisher=Apple Inc.}}</ref>
| [[Classic Mac OS|"classic" Mac&nbsp;OS]], [[BeOS]] <small>(PPC only)</small>
| style="text-align: center;" | none
Line 212 ⟶ 254:
| {{No}}
|-
! scope="row" | [[COM file (#DOS) binary format|COM (DOS)]]
| [[DOS]], [[OS/2]], [[Windows]] <small>(except for 64-bit editions)</small>, [[Concurrent&nbsp;CP/M-86]] <small>([[Basic Disk Operating System|BDOS]] 3.1 only)</small>, [[Concurrent&nbsp;DOS]], [[Concurrent&nbsp;DOS&nbsp;286]], [[FlexOS]], [[Concurrent&nbsp;DOS&nbsp;386]], [[Multiuser&nbsp;DOS]], [[Datapac System Manager|System&nbsp;Manager]], [[REAL/32]], [[DOS&nbsp;Plus]]
| style="text-align: center;" | <code>[[COM file|.COM]]</code>
Line 230 ⟶ 272:
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{Yes}}
| {{Some|Extension}} <small>(Novell/Caldera [[VERSION.EXE|VERSION]] etc.)</small>
| {{No}}
| {{Some|Extension}}
Line 254 ⟶ 296:
| [[MS-DOS 4.0 (multitasking)]], [[OS/2]], [[Windows]], [[HX&nbsp;DOS&nbsp;Extender]]
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{unk}}
| {{unkYes}}
| {{unkYes}}
| {{No}}
| {{unk}}
| {{unk}}
| {{No}}
| {{Yes}}
| {{No}}
| {{some|Only [[DOS MZ executable|MZ (DOS)]]<ref>[[New_Executable#DOS_stub|DOS stub of New Executable]]</ref>}}
| {{Yes}}
|-
Line 285 ⟶ 327:
| {{No}}
| {{Yes}}
| {{Yes}}<ref>{{cite web |url=http://ftpwww.sunetoldlinux.seorg/pubLinux.old/OS2study/hobbessabre/os2os/devfiles/infoExecutables/lxexeLX.doctxt |title=LX - Linear eXecutable Module Format Description |date=3 June 1992 |accessdateaccess-date=97 July 20122019}}</ref>
| {{No}}
| {{No}}
| {{Yes}}
|-
! scope="row" | [[Portable Executable|PE]]
| [[Windows]], [[ReactOS]], [[HX&nbsp;DOS&nbsp;Extender]], [[BeOS]] <small>(R3 only)</small>
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{Yes}}<ref>{{cite web|url=http://www.microsoft.com/whdc/winlogo/drvsign/Authenticode_PE.mspx |title=Windows Authenticode Portable Executable Signature Format |publisher=Microsoft |date=29 August 2008 |accessdate=9 July 2012}}</ref>
| {{Yes}}
| {{Yes}}
| {{No}}
| {{No}}
| {{Yes}}
|-
! scope="row" | [[Portable Executable|PE32+]]
| [[Windows]] <small>(64-bit editions only)</small>
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}<ref>{{cite web|url=https://docs.microsoft.com/en-us/windows/desktop/winprog64/wow64-implementation-details |title=WOW64 Implementation Details |publisher=Microsoft |date=31 May 2018 |accessdate=5 September 2018}}</ref>
| {{Yes}}
|-
Line 398 ⟶ 414:
{{notelist|refs=
<ref name=metadata>
:Metadata is casually used to describe the controlling data used in software architectures that are more abstract or configurable. Most executable file formats include what may be termed "metadata" that specifies certain, usually configurable, behavioral [[run timeruntime (program lifecycle phase)|runtime]] characteristics. However, it is difficult if not impossible to precisely distinguish program "metadata" from general aspects of [[Von Neumann architecture|stored-program computing architecture]]; if the machine reads it and acts uponon it, it is a computational [[Instruction (computer science)|instruction]], and the prefix "meta" has little significance.
:In [[Java (programming language)|Java]], the [[ClassJava (file format)|class file]] format]] contains metadata used by the [[Java compiler]] and the [[Java virtual machine]] to [[dynamicDynamic linkinglinker|dynamically link]] [[classClass (computer scienceprogramming)|classes]] and to support [[reflectionreflective programming]] (computer sciencereflection)|reflection]]. The [[Java Platform, Standard Edition]] since J2SE 5.0 has included a [[metadata facility for Java|metadata facility]] to allow additional annotations that are used by [[development tool]]s.
:In [[MS-DOS]], the [[COM file]] format does ''not'' normally include metadata, while the [[EXE]] file and Windows [[Portable Executable|PE]] (PE) formats do. These metadata can include the company that published the program, the date the program was created, the version number, and more.
:In the [[.NET Framework]] framework executable format, extra metadata is included to allow [[Reflection (computerReflective science)programming|reflection]] at runtime.</ref>
}}