Mach-O (pronounced as "macho"), 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, utilizes 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 Universal Binaries, which are applications (executable files), dylibs (dynamically-linked shared libraries), or Mach-O bundles (code dynamically loaded at run time) with PowerPC and x86 executable code in the same executable file, usable on both IBM/Motorola & Intel based Macintoshes, and 32-bit/64-bit PowerPC binaries, which are applications, dylibs, or Mach-O bundles with 32-bit and 64-bit PowerPC executable code in the same file, so that they can run on 32-bit IBM/Motorola based Macintoshes but will run 64-bit code rather than 32-bit code on 64-bit IBM based Macintoshes.