Mach-O

From Wikipedia, the free encyclopedia

Mach-O
Mac OS X Executable Binary icon
File extension: none, .o, .dylib
Uniform Type Identifier: com.apple.mach-o-binary
Developed by: Carnegie Mellon University/Apple Inc.
Type of format: Binary, executable, object, shared libraries, core dump
Container for: Sparc, PA-RISC, PowerPC and x86 executable code, memory image dumps

Mach-O (pronounced as "mac O"[citation needed]), short for Mach object file format, is a file format for executables, object code, shared libraries, dynamically-loaded code, and core dumps. An executable file format specifies the order in which code and data is loaded into memory, as ordering of code and data in the file.

Mach-O was once used by most systems that based on the Mach kernel. NeXTSTEP, Darwin and Mac OS X are examples of systems that have used this format for native executables, libraries and object code. GNU Hurd, which uses GNU Mach as its microkernel, uses ELF, and not Mach-O, as its standard binary format. Mac OS X is probably the last system using Mach-O today.

Binaries are divided into segments. Each segment consists of zero or more sections.

Mach-O files support more than one type of machine code in the file. Apple uses this feature to create Mac OS X Universal binaries, which can run on either 32-bit x86, 64-bit x86 (x86-64), 32-bit PowerPC, or 64-bit PowerPC Macintoshes; they are in the form of applications, dynamically-linked shared libraries (dylibs), or Mach-O bundles (code dynamically loaded at runtime). The operating system is then able to select which executable code to use, based on the computer's architecture.

[edit] See also

[edit] External links

In other languages