FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/Fat_binary

Fat binary

A fat binary (or multiarchitecture binary) is a computer executable program or library which has been expanded (or "fattened") with code native to multiple instruction sets which can consequently be run on multiple processor types. This results in a file larger than a normal one-architecture binary file, thus the name.

The usual method of implementation is to include a version of the machine code for each instruction set, preceded by a single entry point with code compatible with all operating systems, which executes a jump to the appropriate section. Alternative implementations store different executables in different forks, each with its own entry point that is directly used by the operating system.

The use of fat binaries is not common in operating system software, except on NeXTSTEP and NeXTSTEP-derived Apple operating systems such as macOS and iOS (see below); there are several alternatives to solve the same problem, such as the use of an installer program to choose an architecture-specific binary at install time (such as with Android multiple APKs), selecting an architecture-specific binary at runtime (such as with Plan 9's union directories and GNUstep's fat bundles), distributing software in source code form and compiling it in-place, or the use of a virtual machine (such as with Java) and just-in-time compilation.

struct fat_header) containing two unsigned integers. The first integer ("magic") is used as a magic number to identify this file as a Fat Binary. The second integer (nfat_arch) defines how many Mach-O Files the archive contains (how many instances of the same program for different architectures). After this header, there are
Apple Universal binary logo

In 2005, Apple announced another transition, from PowerPC processors to Intel x86 processors. Apple promoted the distribution of new applications that support both PowerPC and x86 natively by using executable files in Multi-Architecture Binary format. Apple calls such programs "Universal applications" and calls the file format "Universal binary" as perhaps a way to distinguish this new transition from the previous transition, or other uses of Multi-Architecture Binary format.

Universal binary format was not necessary for forward migration of pre-existing native PowerPC applications; from 2006 to 2011, Apple supplied Rosetta, a PowerPC (PPC)-to-x86 dynamic binary translator, to play this role. However, Rosetta had a fairly steep performance overhead, so developers were encouraged to offer both PowerPC and Intel binaries, using Universal binaries. The obvious cost of Universal binaries is that every installed executable file is larger, but in the years between the introduction of Mac OS X and the switch to Intel, hard-drive space greatly outstripped executable size; while a Universal binary might be double the size of a single-platform version of the same application, the extra size is generally negligible given the amount of free space usually available. In fact, Universal-binary applications are often smaller than two single-architecture applications because program resources can be shared rather than duplicated. If not all of the architectures are required, the


View original on Wikipedia | Back | FazBrowse Home