GO-V.ORG
As seen in

Mach-O

Mach-O (Mach object) is a file format for executables, object code, shared libraries, dynamically loaded code, and core dumps. It was developed to replace the a.out format. Mach-O is used by some systems based on the Mach kernel. NeXTSTEP, macOS, and iOS are examples of systems that use this format for native executables, libraries and object code. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

Mach-O (Mach object) is a file format for executables, object code, shared libraries, dynamically loaded code, and core dumps. It was developed to replace the a.out format. Mach-O is used by some systems based on the Mach kernel. NeXTSTEP, macOS, and iOS are examples of systems that use this format for native executables, libraries and object code. A segment value of 3 would mean the offset to the data of the fourth segment load command in the Mach-O file starting from zero up (0,1,2,3 = 4th segment). Sections are also numbered from sections 1 and up. Section value zero is used in the symbol table for symbols that are not defined in any section (undefined). Such as a method, or data that exist within another binaries symbol table section. A segment that has seven sections would mean the last section is 8. Then if the following segment load command has three sections they are labelled as sections 9, 10, and 11. A section number of 10 would mean the second segment, section 2. One would not be able to properly read the symbol table and linking information if we do not store the order the sections are read in and their address/file offset position. One can easily use file offset without using the RAM addresses and relocations to build a symbol reader and to read the link edit sections and even map method calls or design a disassembler. If building a Mach-O loader, then you want to dump the sections to the defined RAM addresses plus a base address to keep applications spaced apart so they do not write over one another. The segment names and section names can be renamed to anything you like and there link will be no problems locating the appropriate sections by section number, or segment number as long as you do not alter the order the segment commands go in. With the introduction of Mac OS X 10.6 platform the Mach-O file underwent a significant modification that causes binaries compiled on a computer running 10.6 or later to be (by default) executable only on computers running Mac OS X 10.6 or later. The difference stems from load commands that the dynamic linker, in previous Mac OS X versions, does not understand. 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 make backwards-compatible executables, the linker flag "-mmacosx-version-min=" can be used. ==Other implementations== ==See also== Fat binary Universal binary Dynamic linker Mac transition to Intel processors Mac transition to Apple silicon Xcode PE ELF Comparison of executable file formats ==References== ==External links== (Apple Inc.) Mach Object Files (NEXTSTEP documentation) Mach-O Dynamic Library Reference Mach-O linking and loading tricks MachOView JDasm (Cross-platform disassembler, for macOS, iOS, windows PE, ELF, and file format analysis tool)

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Mach-O". 1790214985. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1376436976

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·