Comparison of executable file formats: Difference between revisions

Content deleted Content added
FrescoBot (talk | contribs)
m Bot: links syntax
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).
 
(142 intermediate revisions by 71 users not shown)
Line 1:
{{Short description|none}} <!-- This short description is INTENTIONALLY "none" - please see WP:SDNONE before you consider changing it! -->
This is a comparison of [[executable]] [[file format]]s.
{{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 being 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" border="1"
{{sort-under}}
{| class="wikitable sortable sort-under sticky-header"
|-
! scope="col" | Format name
!
! scope="col" | Operating system
! [[Icon (computing)|Icon]]
! scope="col" | [[Filename extension]]
! [[Metadata#Program_metadata|Metadata]]
! scope="col" | Explicit processor declarations
! [[Code signing|Digital signature]]
! scope="col" | Arbitrary [[memory segmentation|sections]]
! [[String (computer science)|String table]]
! scope="col" | [[Metadata]]{{efn|name=metadata}}
! [[Symbol table]]
! scope="col" | [[Code signing|Digital signature]]
! [[64-bit]]
! scope="col" | [[String (computer science)|String]] table
! Multiple architectures in single file
! 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]]
! [[a.out]]
| [[Unix-like]], [[OpenVMS]], [[BeOS]] <small>from R4 onwards</small>, [[Haiku_(operating_system)|Haiku]], [[SerenityOS]]
| {{no}}
| style="text-align: center;" | none
| {{no}}
| {{noYes}} by file
| {{Yes}}
| {{yes}}<ref name=aout>[http://www.freebsd.org/cgi/man.cgi?query=a.out&sektion=5 a.out(5) - FreeBSD Man Pages]</ref>
| {{Yes}}
| {{yes}}<ref name=aout></ref>
| {{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}}
| {{No}}
| {{No}}
| {{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}}
| {{No}}
| {{No}}
|-
! scope="row" | [[a.out]]
| [[Unix-like]]
| style="text-align: center;" | none
| {{No}}
| {{No}}
| {{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 |access-date=9 July 2012}}</ref>
| {{Yes}}<ref name=aout />
| {{Some|Extension}}
| {{No}}
| {{No}}
|-
! scope="row" | [[COFF]]
| [[Unix-like]]
| style="text-align: center;" | none
| {{Yes}} by file
| {{Yes}}
| {{No}}
| {{No}}
| {{Yes}}
| {{Yes}}
| {{Some|Extension}}
| {{No}}
| {{No}}
|-
! scope="row" | [[ECOFF]]
| [[Ultrix]], [[Tru64&nbsp;UNIX]], [[IRIX]]
| style="text-align: center;" | none
| {{Yes}} by file
| {{Yes}}
| {{No}}
| {{No}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{No}}
| {{No}}
|-
! scope="row" | [[XCOFF]]
| [[IBM&nbsp;AIX]], [[BeOS]], [[Classic Mac OS|"classic" Mac&nbsp;OS]]
| style="text-align: center;" | none
| {{Yes}} by file
| {{Yes}}
| {{No}}
| {{No}}
| {{Yes}}
| {{Yes}}<ref>{{cite web|url=http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.files/doc/aixfiles/XCOFF.htm|title=Files Reference – XCOFF Object File Format|publisher=IBM}}</ref>
| {{Yes}}
| {{No}}
| {{No}}
|-
! scope="row" | [[System Object Model (file format)|SOM]]
| [[HP-UX]], [[MPE/ix]]
| {{dunno}}
| {{unk}}
| {{unk}}
| {{No}}
|-
| {{No}}
! [[COFF]]
| {{no}}
| {{no}}
| {{no}}
| {{yes}}
| {{yes}}
| {{unk}}
| {{Yes}}
| {{No}}
| {{unk}}
| {{No}}
|-
! scope="row" | [[Amiga Hunk]]
! [[Executable and Linkable Format|ELF]]
| [[AmigaOS]]
| {{no}}
| style="text-align: center;" | none
| {{yes}}
| {{noNo}}
| {{yesYes}}
| {{Yes}}
| {{yes}}<ref>[http://uw714doc.sco.com/en/man/html.3elf/elf_getarsym.3elf.html (3elf) - Elf library routines]</ref>
| {{yesNo}}
| {{No}}
| {{some}}<ref name=FatELF>[http://icculus.org/fatelf/ FatELF: Universal Binaries for Linux]</ref>
| {{Yes}}
| {{No}}
| {{Yes}}
| {{No}}
|-
! scope="row" | [[Preferred Executable Format|PEF]]<ref name="apple-pef">{{cite web|archive-url=https://web.archive.org/web/20080512065331/http://developer.apple.com/tools/mpw-tools/commandref/dumppef.html|title=MPW Command Reference - DumpPEF|archive-date=12 May 2008|url=https://developer.apple.com/tools/mpw-tools/commandref/dumppef.htm|publisher=Apple Inc.}}</ref>
! [[Portable Executable|PE]]
| [[Classic Mac OS|"classic" Mac&nbsp;OS]], [[BeOS]] <small>(PPC only)</small>
| {{yes}}
| style="text-align: center;" | none
| {{yes}}
| {{Yes}} by file
| {{yes}}<ref>[http://www.microsoft.com/whdc/winlogo/drvsign/Authenticode_PE.mspx Windows Authenticode Portable Executable Signature Format]</ref>
| {{yesNo}}
| {{yesNo}}
| {{yesNo}}
| {{yesYes}}
| {{Yes}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | [[CMD file (CP/M)|CMD]]
! [[Mach-O]]
| [[CP/M-86]], [[MP/M-86]], [[Concurrent&nbsp;CP/M-86]], [[Personal&nbsp;CP/M-86]], [[S5-DOS]], [[Concurrent&nbsp;DOS]], [[Concurrent&nbsp;DOS&nbsp;286]], [[FlexOS]], [[S5-DOS/ST]], [[S5-DOS/MT]], [[Concurrent&nbsp;DOS&nbsp;386]], [[Multiuser&nbsp;DOS]], [[Datapac System Manager|System&nbsp;Manager]], [[REAL/32]], [[DOS&nbsp;Plus]]
| {{no}}
| style="text-align: center;" | <code>.CMD</code>
| {{yes}}<ref name=macosx>[http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html#//apple_ref/doc/uid/20001298-BAJIHABI Mac OS X ABI Mach-O File Format Reference ]</ref>
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{yes}}
| {{yesYes}}
| {{yesNo}}<ref name=macosx/>
| {{yesNo}}
| {{Some|Extension}}
| {{yes}}<ref name=FatMach-O>[[Fat binary]]</ref>
| {{Some|Extension}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | FlexOS 186
! [[System Object Model (file format)|SOM]]
| [[FlexOS&nbsp;186]], [[FlexOS&nbsp;286]], [[S5-DOS/ST]], [[S5-DOS/MT]], [[4680&nbsp;OS]], [[FlexOS&nbsp;386]], [[4690&nbsp;OS]]
| {{no}}
| style="text-align: center;" | <code>[[.186]]</code>
| {{no}}
| {{No}} <small>([[Intel 80186|186]]/[[Intel 80188|188]] and higher only)</small>
| {{no}}
| {{Yes}}
| {{No}}
| {{No}}
| {{Some|Extension}}
| {{Some|Extension}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | FlexOS 286
| [[FlexOS&nbsp;286]], [[S5-DOS/ST]], [[S5-DOS/MT]], [[4680&nbsp;OS]], [[FlexOS&nbsp;386]], [[4690&nbsp;OS]]
| style="text-align: center;" | <code>[[.286]]</code>
| {{No}} <small>([[Intel 80286|286]] and higher only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{Some|Extension}}
| {{Some|Extension}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | CP/M-68K
| [[CP/M-68K]], [[Concurrent&nbsp;DOS&nbsp;68K]], [[FlexOS&nbsp;68K]]
| style="text-align: center;" | <code>[[.68K]]</code>
| {{No}} <small>([[Motorola 68000|68000]] and higher only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{unk}}
| {{yes}}
| {{no}}
| {{unk}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | [[COM file (CP/M)|COM (CP/M)]]
! [[Amiga Hunk|Hunk]]
| [[CP/M]], [[MP/M]], [[Concurrent&nbsp;CP/M]], [[Personal&nbsp;CP/M]]
| {{no}}
| style="text-align: center;" | <code>[[COM file|.COM]]</code>
| {{yes}}
| {{No}} <small>([[Intel 8080|8080]]/[[Zilog Z80|Z80]] only)</small>
| {{no}}
| {{Some|Extension}} <small>([[Basic Disk Operating System|BDOS]] 3 and higher only)</small>
| {{no}}
| {{yesNo}}
| {{noNo}}
| {{yesNo}}
| {{No}}
| {{No}}
| {{Some|Extension}}
| {{No}}
|-
! scope="row" | [[COM file#DOS MZbinary executableformat|DOSCOM MZ(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]]
| {{no}}
| style="text-align: center;" | <code>[[COM file|.COM]]</code>
| {{no}}
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{no}}
| {{No}}
| {{Some|Extension}} <small>(Novell/Caldera [[VERSION.EXE|VERSION]] etc.)</small>
| {{No}}
| {{No}}
| {{No}}
| {{Some|Extension}}<!-- DOS does not care if the executable code is 16-bit/32-bit or 64-bit for as long as the APIs are accessed correctly -->
| {{Some|Extension}}
| {{No}}
|-
! scope="row" | [[DOS MZ executable|MZ (DOS)]]
| [[DOS]], [[OS/2]], [[Windows]] <small>(except for 64-bit editions)</small>, [[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>[[.EXE]]</code>
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{Yes}}
| {{Some|Extension}} <small>(Novell/Caldera [[VERSION.EXE|VERSION]] etc.)</small>
| {{No}}
| {{Some|Extension}}
| {{Some|Extension}}
| {{Some|Extension}}<!-- DOS does not care if the executable code is 16-bit/32-bit or 64-bit for as long as the APIs are accessed correctly -->
| {{No}}
| {{No}}
|-
! scope="row" | MZ (GEM)
| [[Graphics Environment Manager|GEM]], [[ViewMAX]]<!-- , [[Ventura Publisher]] -->
| style="text-align: center;" | <code>.APP/.ACC</code>
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{unk}}
| {{unk}}
| {{noNo}}
| {{noNo}}
| {{unk}}
|-
! scope="row" | [[New Executable|NE]]
! [[COM file|DOS COM]]
| [[MS-DOS 4.0 (multitasking)]], [[OS/2]], [[Windows]], [[HX&nbsp;DOS&nbsp;Extender]]
| {{no}}
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{no}}
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{no}}
| {{noYes}}
| {{noYes}}
| {{noNo}}
| {{noNo}}
| {{Yes}}
| {{No}}
| {{some|Only [[DOS MZ executable|MZ (DOS)]]<ref>[[New_Executable#DOS_stub|DOS stub of New Executable]]</ref>}}
| {{Yes}}
|-
! scope="row" | [[LE executable|LE]], ([[Windows W3 executable|W3]], [[Windows W4 executable|W4]])
! [[Preferred Executable Format|PEF]]
| [[OS/2]] <small>(2.0 and higher only)</small>, some [[DOS extender]]s
| {{no}}
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{no}}
| {{Yes}} by file <small>([[Intel 80286|286]] and higher only)</small>
| {{no}}
| {{unkYes}}
| {{yesYes}}
| {{noNo}}
| {{noYes}}
| {{Yes}}
| {{No}}
| {{No}}
| {{Yes}}
|-
! scope="row" | [[LX executable|LX]]
! [[ECOFF]]
| [[OS/2]] <small>(2.0 and higher only)</small>, some 32-bit [[DOS extender]]s
| style="text-align: center;" | <code>[[.EXE]]</code>
| {{Yes}} by file
| {{Yes}}
| {{Yes}}
| {{No}}
| {{Yes}}
| {{Yes}}<ref>{{cite web |url=http://www.oldlinux.org/Linux.old/study/sabre/os/files/Executables/LX.txt |title=LX - Linear eXecutable Module Format Description |date=3 June 1992 |access-date=7 July 2019}}</ref>
| {{No}}
| {{No}}
| {{Yes}}
|-
! scope="row" | [[Personal Information Manager|PIM]]/[[Execute In Place|XIP]]
| [[PalmDOS]] <small>([[MINIMAX]] applications only)</small>
| style="text-align: center;" | <code>[[.PIM]]/[[.XIP]]</code>
| {{No}} <small>([[Intel x86|x86]] only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" id=.exm | [[DL executable|DL]]
| [[MS-DOS]] [[System Manager (HP LX)|System&nbsp;Manager]] applications <small>([[HP LX series]] only)</small>
| style="text-align: center;" | <code>[[.EXM]]</code>
| {{No}} <small>([[Intel 80186|186]]/[[Intel 80188|188]] and higher only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" id=.exp | [[MP executable|MP]]
| [[Phar Lap (company)|Phar&nbsp;Lap]] [[DOS extender]]s
| style="text-align: center;" | <code>[[.EXP]]</code>
| {{unk}} <small>([[Intel 80286|286]] and higher only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{unk}}
| {{unk}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | [[P2 executable|P2]]
| [[Phar Lap (company)|Phar&nbsp;Lap]] 16-bit [[DOS extender]]s
| style="text-align: center;" | <code>[[.EXP]]</code>
| {{unk}} <small>([[Intel 80286|286]] and higher only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{unk}}
| {{yes}}
| {{yes}}
| {{yes}}
| {{unk}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | [[P3 executable|P3]]
! [[XCOFF]]
| [[Phar Lap (company)|Phar&nbsp;Lap]] 32-bit [[DOS extender]]s
| style="text-align: center;" | <code>[[.EXP]]</code>
| {{unk}} <small>([[Intel 80386|386]] and higher only)</small>
| {{Yes}}
| {{No}}
| {{No}}
| {{unk}}
| {{unk}}
| {{No}}
| {{No}}
| {{No}}
|-
! scope="row" | GEOS
| [[PC/GEOS]], [[Geoworks&nbsp;Ensemble]], [[NewDeal&nbsp;Office]], [[Breadbox&nbsp;Ensemble]]
| style="text-align: center;" | <code>[[.GEO]]</code>
| {{unk}} <small>([[Intel x86|x86]] only)</small>
| {{unk}}
| {{yes}}
| {{yes}}<ref>[http://publib16.boulder.ibm.com/pseries/en_US/files/aixfiles/XCOFF.htm#yaa3i18fjbau Files Reference – XCOFF Object File Format]</ref>
| {{yes}}
| {{unk}}
| {{No}}
|-
! [[OS/2 LX|LX]]
| {{yes}}
| {{unk}}
| {{unk}}
| {{noNo}}
| {{No}}
| {{yes}}<ref>[http://ftp.sunet.se/pub/OS2/hobbes/os2/dev/info/lxexe.doc Linear eXecutable Module Format]</ref>
| {{nounk}}
| {{no}}
|-
|}
 
== Notes ==
{{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 [[runtime (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 on it, it is a computational [[Instruction (computer science)|instruction]], and the prefix "meta" has little significance.
:In [[Java (programming language)|Java]], the [[Java class file]] format contains metadata used by the [[Java compiler]] and the [[Java virtual machine]] to [[Dynamic linker|dynamically link]] [[Class (computer programming)|classes]] and to support [[reflective programming]] (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 [[DOS]], the [[COM file]] format does ''not'' normally include metadata, while the [[EXE]] file and Windows [[Portable Executable]] (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 executable format, extra metadata is included to allow [[Reflective programming|reflection]] at runtime.</ref>
}}
 
== References ==
{{reflistReflist}}
 
{{Executables}}
 
{{DEFAULTSORT:Comparison Of Executable File Formats}}
{{software-type-stub}}
 
[[Category:Computing comparisons]]
[[Category:Executable file formats| ]]