Skip to content

Commit 94bfafa

Browse files
authored
Merge pull request #96 from rjmccall/intro-write-portability
[Editorial] Rewrite the introduction, standardize on "base C ABI", prepare for portability
2 parents b6649b6 + 958b90e commit 94bfafa

File tree

2 files changed

+57
-31
lines changed

2 files changed

+57
-31
lines changed

abi.html

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,40 +61,64 @@ <h2> Contents </h2>
6161
<h2><a href="#acknowledgements"> Acknowledgements</a></h2>
6262
<p> <hr> <p>
6363

64-
<p>This document was developed jointly by an informal industry
65-
coalition consisting of (in alphabetical order) CodeSourcery, Compaq,
66-
EDG, HP, IBM, Intel, Red Hat, and SGI. Additional contributions were
67-
provided by a variety of individuals.</p>
64+
<p>This document was originally developed jointly by an informal
65+
industry coalition consisting of (in alphabetical order) CodeSourcery,
66+
Compaq, EDG, HP, IBM, Intel, Red Hat, and SGI. Additional contributions
67+
were provided by a variety of individuals. It is now developed as an
68+
open-source project with contributions from a variety of individuals
69+
and companies.</p>
6870

6971
<p> <hr> <p>
7072
<a name="intro">
7173
<h2><a href="#intro"> Chapter 1: Introduction </a></h2>
7274
<p> <hr> <p>
7375

74-
In this document, we specify the Application Binary Interface for
75-
C++ programs,
76-
that is, the object code interfaces between user C++ code and the
77-
implementation-provided system and libraries.
78-
This includes the memory layout for C++ data objects,
79-
including both predefined and user-defined data types,
80-
as well as internal compiler generated objects such as virtual tables.
81-
It also includes function calling interfaces,
82-
exception handling interfaces,
83-
global naming,
84-
and various object code conventions.
85-
86-
<p>
87-
In general, this document is written as a generic specification,
88-
to be usable by C++ implementations on a variety of architectures.
89-
However, it does contain processor-specific material for the Itanium
90-
64-bit ABI, identified as such.
91-
Where structured data layout is described,
92-
we generally assume Itanium psABI member sizes.
93-
An implementation for a 32-bit ABI would typically just change the
94-
sizes of members as appropriate
95-
(i.e. pointers and long ints would become 32 bits),
96-
but sometimes an order change would be required for compactness,
97-
and we note more substantive changes.
76+
In this document, we specify the Application Binary Interface (ABI)
77+
for C++ programs: that is, the object code interfaces between different
78+
user-provided C++ program fragments and between those fragments and
79+
the implementation-provided runtime and libraries. This includes the
80+
memory layout for C++ data objects, including both predefined and
81+
user-defined data types, as well as internal compiler generated
82+
objects such as virtual tables. It also includes function calling
83+
interfaces, exception handling interfaces, global naming, and various
84+
object code conventions.
85+
86+
<p>
87+
In general, this document is meant to serve as a generic specification
88+
which can be used by C++ implementations on a variety of platforms.
89+
It does this by layering on top of a platform's base C ABI. However,
90+
it was originally written for the Itanium architecture, and some parts
91+
still directly make Itanium-specific or 64-bit-specific assumptions.
92+
There is an ongoing project to restate the entire C++ ABI specification
93+
in terms of portable C concepts that are defined in the C ABI. In
94+
the meantime, it is usually straightforward to recognize these
95+
unportable assumptions and translate them appropriately, e.g. by
96+
replacing a 64-bit pointer with a 32-bit pointer.
97+
98+
<p>
99+
This document is not an authoritative definition of the C++ ABI for
100+
any particular platform. Platform vendors retain the ultimate power
101+
to define the C++ ABI for their platform. Platforms using this ABI
102+
for C++ should declare that they do so, either unmodified or with a
103+
certain set of changes.
104+
105+
<p>
106+
While this ABI has generally stood up well, there are some parts of it
107+
that are now seen as mistakes. This document includes several
108+
recommendations for platforms adopting this ABI with no need to
109+
interoperate with existing C++ object code. These recommendations
110+
appear as follows:
111+
112+
<blockquote>
113+
<span class="future-abi">Recommendation for new platforms: consider
114+
forbidding the use of function templates on your platform so that
115+
the ABI can remove these expression-mangling rules.</span>
116+
</blockquote>
117+
118+
<p>
119+
Platforms adopting any of these recommendations should describe the
120+
exact changes they've made in their platform ABI documentation,
121+
as the set of recommendations in this document may change over time.
98122

99123
<p> <hr> <p>
100124
<a name="definitions">
@@ -262,7 +286,7 @@ <h3><a href="#definitions"> 1.1 Definitions </a></h3>
262286
complement of the definition in [class.temporary]p3 of types for which
263287
an extra temporary is allowed when passing or returning a type. A type
264288
which is trivial for the purposes of the ABI will be passed and returned
265-
according to the rules of the underlying C ABI, e.g. in registers; often
289+
according to the rules of the base C ABI, e.g. in registers; often
266290
this has the effect of performing a trivial copy of the type.
267291
</p>
268292
</dd>
@@ -630,7 +654,7 @@ <h3><a href="#pod"> 2.2 POD Data Types </a></h3>
630654

631655
<p>
632656
The size and alignment of a type which is a <a href="#POD">POD for the
633-
purpose of layout<a> is as specified by the base (C) ABI, with the
657+
purpose of layout<a> is as specified by the base C ABI, with the
634658
following provisos:
635659
</p>
636660

@@ -811,7 +835,7 @@ <h3><a href="#class-types"> 2.4 Non-POD Class Types </a></h3>
811835
<p>
812836
<li>
813837
If <code>sizeof(T)*8 >= n</code>,
814-
the bit-field is allocated as required by the underlying C psABI,
838+
the bit-field is allocated as required by the base C ABI,
815839
subject to the constraint that a bit-field is never placed in the
816840
tail padding of a base class of C.
817841

code.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ H4 { font-size: 1.34em; }
1313
H5 { font-size: 1.05em; font-weight: bold }
1414
H6 { font-size: 1em; font-weight: bold }
1515

16+
SPAN.future-abi { color:green; }
17+
1618
SPAN.change { color:red; }
1719
DIV.change { color:red; }
1820

0 commit comments

Comments
 (0)