![]() |
![]() |
![]() |
|
![]() | |
![]() |
![]() |
![]() |
![]() |
![]() |
Log In | Not a Member? |
Support
![]() |
![]() |
Macintosh C/C++ ABI Overview |
IntroductionAn ABI is an "application binary interface" and describes binary-level conventions for applications running on a particular system. An ABI establishes conventions for such things as register usage, parameter passing, and layout of data. Typically, these conventions are embodied in development tools, particularly compilers. Assembly-level programmers must be aware explicitly of these conventions, especially if they wish to interface their assembly code with code produced by a compiler. The primary goals of an ABI are:
While it is possible for programs to depart from the conventions of an ABI, particularly within isolated sections of a program (such as sections of hand-crafted assembly code), conformance to the ABI is often required to make use of system-level code and code produced by other compilers. To the extent that a program is monolithic and is built with the same set of tools conformance to the ABI is only an issue when the program interfaces with the system. To the extent that a program is made up of (or accesses) components which may have been built with other tools conformance to the ABI is more critical. The C++ language poses special ABI problems. While the C language relies on a few well-established ABI conventions, the object-oriented features of C++ require new runtime architecture and conventions, such as v-tables and name-mangling. While some of these conventions have a common precedent in their implementation in AT&T's CFront, the evolution of the language and the proliferation of compilers has resulted in the availability of many compilers whose binaries are not compatible. While the orginal Annotated C++ Reference Manual suggested how to address some of the ABI issues, many were left as implementation-dependent details. The subsequent evolution of the C++ language has presented further avenues for divergence in compiler runtime conventions. Given the emergence of interoperable components on the Macintosh, it is increasingly important to establish an ABI for C++ for the Macintosh. The foundation level of the Macintosh ABI is documented in the book "Macintosh Runtime Architectures" (to be available in fall '96) which covers various basic conventions such as register usage and parameter passing conventions. What we are calling the "Macintosh C/C++ ABI" covers some special cases of low-level conventions, general conventions for languages such as C and C++, and conventions for C++ specific constructs which get exposed at the ABI level. The Macintosh C/C++ ABI Specification (Version 1.3)The current draft of the Macintosh C/C++ ABI Specification is a work-in-progress for a variety of reasons:
Topics Covered (and to be Covered) by the ABI Specification
FeedbackPlease feel free to discuss any issues in the ABI with us and to identify any potential problem areas. You may reach us at: forsman@apple.com Or you may email us directly. |