Mach-O
Extension |
none, .o, .dylib |
---|---|
PUID | |
Signatures | |
Développé par | |
Type de format |
Mach-O (pour Mach-object) est un format de fichier exécutable, sous Apple/Darwin, alias Mac OS X.
Structure des fichiers Mach-O
Chaque fichier Mach-O est constitué d'un entête, suivi d'une série de commandes de chargement, suivie d'un ou plusieurs segments qui contiennent jusqu'à 255 sections.
Texte anglais à traduire :
Mach-O uses the REL relocation format to handle references to symbols. When looking up symbols Mach-O uses a two-level namespace that encodes each symbol into an 'object/symbol name' pair that is then linearly searched for by first the object and then the symbol name.
The basic structure—a list of variable-length "load commands" that reference pages of data elsewhere in the file—was also used in the executable file format for Accent. The Accent file format was in turn, based on an idea from Spice Lisp.
Multiple Mach-O files can be combined in a multi-architecture binary; this allows a single binary file to contain code to support multiple instruction set architectures. For example, a multi-architecture binary for Mac OS X could contain both 32-bit and 64-bit PowerPC code, or could contain both 32-bit PowerPC or x86 code, or could contain 32-bit PowerPC code, 64-bit PowerPC code, 32-bit x86 code, and 64-bit x86 (x86-64) code.
Le devenir de Mach-O
Avec l'introduction de la version 10.6 de Mac OS X (Snow Leopard), le format Mach-O a subi une importante modification, qui empêche les binaires compilés sous Mac OS X 10.6 d'être exécutés sur des versions plus anciennes du système. La différence vient de certaines commandes de chargement que l'éditeur de liens des anciennes versions de Mac OS X ne comprend pas.
Texte anglais à traduire :
Mach-O Future
With the introduction of Apple's Mac OS X 10.6 platform the Mach-O file has undergone a significant modification that causes binaries compiled on a 10.6 computer to be by default only able to run on a 10.6 computer. The difference stems from load commands that Mac OS X's linker (dyld) can not understand on previous Mac OS X versions. Another significant change to the Mach-O format is the change in how the Link Edit tables (found in the __LINKEDIT section) function. In 10.6 these new Link Edit tables are compressed by removing unused and unneeded bits of information, however Mac OS X 10.5 and earlier cannot read this new Link Edit table format. To resolve this issue, the linker flag "-mmacosx-version-min=" is heavily used and depended on. Apple, current maintainer of the Mach-O format, recommends that all developers now use this flag along with the appropriate SDK headers when creating an application/binary.
Notes et références
- (en) Cet article est partiellement ou en totalité issu de l’article de Wikipédia en anglais intitulé « Mach-O » (voir la liste des auteurs).