Addenda 32
Addenda 32
Arm® Architecture
2024Q3
1.2 Keywords
Addenda to the ABI for the Arm Architecture, errata in the ABI for the Arm Architecture
2
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
1.4 Licence
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To
view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to
Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
Grant of Patent License. Subject to the terms and conditions of this license (both the Public License and
this Patent License), each Licensor hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Licensed Material, where such license applies
only to those patent claims licensable by such Licensor that are necessarily infringed by their
contribution(s) alone or by combination of their contribution(s) with the Licensed Material to which such
contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim
or counterclaim in a lawsuit) alleging that the Licensed Material or a contribution incorporated within the
Licensed Material constitutes direct or contributory patent infringement, then any licenses granted to You
under this license for that Licensed Material shall terminate as of the date such litigation is filed.
1.6 Contributions
Contributions to this project are licensed under an inbound=outbound model such that any such
contributions are licensed by the contributor under the same terms as those in the Licence section.
1.8 Copyright
Copyright (c) 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights
reserved.
3
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Contents
1 Preamble 2
1.1 Abstract 2
1.2 Keywords 2
1.3 Latest release and defects report 2
1.4 Licence 3
1.5 About the license 3
1.6 Contributions 3
1.7 Trademark notice 3
1.8 Copyright 3
2 About this document 6
2.1 Change Control 6
2.1.1 Current Status and Anticipated Changes 6
2.1.2 Change history 6
2.2 References 8
2.3 Terms and abbreviations 9
3 ADDENDUM: Build Attributes 11
3.1 Introduction to build attributes 11
3.1.1 About build attributes and compatibility 11
3.1.2 The kinds of compatibility modeled by build attributes 13
3.1.3 The scope of build attributes 13
3.1.4 Build attributes and conformance to the ABI 14
3.1.5 Combining attribute values 14
3.2 Representing build attributes in ELF files 15
3.2.1 Encoding 15
3.2.2 Structure of an ELF attributes section 15
3.2.3 Formal syntax of an ELF attributes section 16
3.2.4 Formal syntax of a public (“aeabi”) attributes subsection 16
3.2.5 Conformance constraints 17
3.2.6 Coding extensibility and compatibility 17
3.3 Public ("aeabi") attribute tags 18
3.3.1 About public tags 18
3.3.2 Default values for public tags 18
3.3.3 Inheritance of public tag values 18
3.3.4 How this specification describes public attributes 19
3.3.5 Target-related attributes 19
3.3.6 Procedure call-related attributes 23
3.3.7 Miscellaneous attributes 26
3.4 Arm CPU names recognized by Arm Compiler 5.01 (armcc) 30
3.5 Attributes summary and history 30
4 ADDENDUM: Thread Local Storage 35
4.1 Introduction to thread local storage 35
4.2 Introduction to TLS addressing 35
4
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
4.3 Linux for Arm TLS addressing 36
4.3.1 Linux for Arm general dynamic model 36
4.3.2 Linux for Arm static (initial exec) model 38
5 Reserved Names 40
6 Errata and Minor Addenda 42
6.1 DWARF for the Arm Architecture 42
6.1.1 Clarifications 42
6.1.2 Errors fixed 42
6.1.3 Additions and omissions fixed 42
6.2 ELF for the Arm Architecture 42
6.2.1 Clarifications 42
6.2.2 Errors fixed 43
6.2.3 Additions and omissions fixed 43
6.3 Procedure Call Standard for the Arm Architecture 44
6.3.1 Clarifications 44
6.3.2 Errors fixed 45
6.3.3 Additions and omissions fixed 45
6.4 Base Platform ABI for the Arm Architecture 46
6.4.1 Clarifications 46
6.4.2 Errors fixed 46
6.5 C Library ABI for the Arm Architecture 46
6.5.1 Clarifications 46
6.5.2 Errors fixed 46
6.5.3 Additions and omissions fixed 46
6.6 C++ ABI for the Arm Architecture 47
6.6.1 Clarifications 47
6.6.2 Errors fixed 47
6.6.3 Additions and omissions fixed 47
6.7 Exception Handling ABI for the Arm Architecture 47
6.7.1 Clarifications 47
6.7.2 Errors fixed 48
6.7.3 Additions and omissions fixed 49
6.8 Run-time ABI for the Arm Architecture 49
6.8.1 Clarifications 49
6.8.2 Errors fixed and features withdrawn or deprecated 49
6.8.3 Additions and omissions fixed 49
6.9 ABI for the Arm Architecture - The Base Standard 50
6.9.1 Clarifications 50
5
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
2 About this document
2.1 Change Control
v1.01 4th July 2005 Added new Coding extensibility and compatibility. Noted
r2.01 component errata omissions (ELF for the Arm
Architecture, C Library ABI for the Arm Architecture, and
C++ ABI for the Arm Architecture).
6
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Issue Date Change
th
v1.05 8 May 2006 Added missing Tag_FP_arch value for VFPv3
r2.04 (Target-related attributes). Noted errata and omissions
(aadwarf32-errors-fixed, aaelf32-additions-omissions,
aapcs32-clarifications, clibabi32-errors-fixed, and
cppabi32-clarifications).
v1.06 18th January 2007 Major clarification of, and some compatible extension to,
r2.05 ADDENDUM: Build Attributes.
v1.07 23rd October 2007 Added: CPU_arch values for v6S-M and v6-M; and
r2.06 VFP_arch value for VFPv3-D16; added Tag_nodefaults,
Tag_ABI_FP_16bit_format, and Tag_FP_HP_extension.
Rewrote ADDENDUM: Build Attributes. Noted errata and
omissions.
7
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Issue Date Change
th
D r2.09 30 November 2012 Made section and symbol attributes deprecated and
optional (The kinds of compatibility modeled by build
attributes, Formal syntax of a public (“aeabi”) attributes
subsection, Inheritance of public tag values, No defaults
tag). (Formal syntax of a public (“aeabi”) attributes
subsection) clarified section and symbol numbers are
ULEB128. (The target-related attributes) added
architecture v8 values to Tag_CPU_arch, Tag_FP_arch,
Tag_Advanced_SIMD_arch; clarified use of existing
Tag_Advanced_SIMD_arch and Tag_FP_HP_extension
values; clarified the meaning of Tag_DIV_use;
deprecated Tag_T2EE_use. (The procedure call-related
attributes) fixed typo in Tag_ABI_FP_exceptions; clarified
use of Tag_ABI_HardFP_use values and removed
pointless DP-only option; added enum value to
Tag_ABI_VFP_args for code compatible with both the
base and VFP variants. (Secondary compatibility tag
clarified the format of Tag_also_compatible_with data.
Arm CPU names recognized by Arm Compiler 5.01
(armcc)) updated list of recognised CPU names.
E r2.10 24th November 2015 (The target-related attributes) added architecture v8.1
values to Tag_Advanced_SIMD_arch.
F 2018Q4 21st December 2018 In The target-related attributes, deprecated values 1 and
2 of Tag_THUMB_ISA_use, added value 3.
In The target-related attributes, deprecated
Tag_CPU_arch_profile for architecture version 8 onwards.
In The target-related attributes, defined build attributes
for Armv8-M, Armv8-R, Armv8.1-A, Armv8.2-A and
Armv8.3-A.
2021Q1 12th April 2021 Add definitions for PACBTI-M related build attributes: The
target-related attributes, The procedure call-related
attributes, Miscellaneous attributes, Table 1
2.2 References
This document refers to the following documents.
8
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Ref Status / External URL Title
ARMARM ARM Architecture Reference Manual Arm DDI 0406: Arm Architecture
ARMv7-A and ARMv7-R edition Reference Manual Arm v7-A and Arm
v7-R edition
AEABI
(Embedded) ABI for the Arm architecture (this ABI...)
Arm-based
... based on the Arm architecture ...
core registers
The general purpose registers visible in the Arm architecture’s programmer’s model, typically r0-r12,
SP, LR, PC, and CPSR.
EABI
An ABI suited to the needs of embedded, and deeply embedded (sometimes called free standing),
applications.
Q-o-I
Quality of Implementation – a quality, behavior, functionality, or mechanism not required by this
standard, but which might be provided by systems conforming to it. Q-o-I is often used to describe
the toolchain-specific means by which a standard requirement is met.
9
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
VFP
The Arm architecture’s Floating Point architecture and instruction set. In this ABI, this abbreviation
includes all floating point variants regardless of whether or not vector (V) mode is supported.
10
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3 ADDENDUM: Build Attributes
3.1 Introduction to build attributes
Compiler / Compiler /
assembler assembler
User
intentions
User about
intentions compatibility
about
compatibility Relocatable Relocatable
Relocatablefile Relocatablefile
Relocatable
file Relocatable
file
file
Attributes file
Attributes
Attributes Attributes
Attributes Attributes
Compatibility Compatibility
model A model B
Linker Linker
Exchange of portable
Tool chain A relocatable files Tool chain B
• Within a toolchain, build attributes generate rich opportunities for a linker to diagnose
incompatibility, enforce compatibility, and select library members intelligently according to its
compatibility model.
• Between toolchains, build attributes describe the intended compatibility of a relocatable file and the
entities it defines in terms independent of either toolchain, promoting safe exchange of portable
code in binary form.
11
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3.1.1.1 Attribute values are based on user intentions
We base attribute values on user intentions to avoid the values being an unpredictable (effectively
random) function of a compiler’s code generation algorithms and to support using attributes with
assembly language without overburdening programmers. Where attributes support exchanging portable
relocatable files among toolchains, predictability is worth more than precision.
Capturing a user’s compile-time intentions about compatibility is also important at link time. For example:
• A user might permit a compiler to use both the Arm ISA and the Thumb ISA.
(The user intends the code to be usable on any processor that has both the Arm ISA and the Thumb
ISA).
• The compiler might choose to use only the Thumb ISA in a specific build of a source file.
Nonetheless, the relocatable file should be tagged as having been permitted to use the Arm ISA so
that a linker can later link it with Arm-state library code and generate Arm-state intra-call veneers if
that gives benefit to the executable file.
On the other hand, if the user intends code to be executed by both Arm7TDMI and Cortex-M3, the
compiler must be constrained to generate only Thumb v1 instructions and the relocatable file should be
tagged as not permitted to use the Arm ISA.
12
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3.1.2 The kinds of compatibility modeled by build attributes
Build attributes primarily model two kinds of compatibility.
• The compatibility of binary code with target hardware conforming to a revision of the Arm
Architecture.
• The procedure-call compatibility between functions conforming to variants of this ABI.
The intuitive notion of compatibility can be given a mathematically precise definition using sets of
demands placed on an execution environment.
For example, a program could be defined to be compatible with a processor if (and only if) the set of
instructions the program might try to execute is a subset of the set of instructions implemented by the
processor.
Target-related attributes (Target-related attributes) describe the hardware-related demands a relocatable
file will place on an execution environment through being included in an executable file for that
environment.
For example, target-related attributes record whether use of the Thumb ISA is permitted, and at what
architectural revision use is permitted. A pair of values for these attributes describes the set of Thumb
instructions that code is permitted to execute and that the target processor must implement.
Procedure call-related attributes (Procedure call-related attributes) describe features of the ABI contract
that the ABI allows to vary, such as whether floating point parameters are passed in floating point
registers, the size of wchar_t, whether enumerated values are containerized according to their size, and
so on.
We can also understand procedure call-related compatibility in terms of sets of demands placed on an
execution environment, but the modeling is more difficult. In this case the environment is less obvious,
more abstract, and elements of it can depend on an operating system or the toolchain itself.
Mathematically, A compatible with B can be understood as: {demands made by A} {demands made by
B}.
Making this concrete sometimes requires combining information from several tags. Writing {T16@v4T} to
denote the set of 16-bit Thumb instructions a processor must execute to conform to architecture version
v4T, we can understand T16@v4T compatible with T16@v5TE as {T16@v4T} {T16@v5TE}.
• File-scope attributes that model the compatibility of binary instructions with processors naturally
apply to each instruction in every code-containing section in the file.
(They obviously do not apply to sections that contain no code, nor to the data – such as literal pools
– embedded in code sections).
• Attributes that describe the procedure call-compatibility of functions naturally apply to every function
symbol defined in the code sections contained within the file.
13
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
For the public build attributes defined by this ABI (Public ("aeabi") attribute tags) a compiler for C/C++
can only need to use section and symbol attributes in the presence of #pragmas, language extensions, or
other mechanisms that affect the compatibility of individual entities within a binary file.
Linkers that support relocatable file merging – termed partial linking by RealView linkers – will, in general,
need to transfer the file scope attributes of an input file to the individual sections that file contributes to
the output file.
This standard places no requirements on the presence or absence of build attributes in executable files.
Note
From the 2.09 release, section and symbol attributes are deprecated and optional. Primary object
producers are discouraged from generating them and consumers are permitted to ignore them.
A claim to conform to ABI version “0” denotes that no unconditional claim to conform is being made.
Generic compatibility tags (Generic compatibility tag) may then describe limited or conditional claims to
conform.
In revisions of this specification before r2.05 any claim to conform to this ABI was implicit, and the
version to which conformance was (possibly) claimed was implicitly “2”.
14
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Note that the appropriate partial order to use can evolve over time as the underlying specifications
evolve.
• If a1 ≤ a2, a1 + a2 = a2. Similarly, if a2 ≤ a1, a1 + a2 = a1. (‘+’ behaves like the maximum
function).
• If a1 <> a2 there are two mutually exclusive sub-cases.
In this second sub-case it is a matter of notational taste whether a1 + a2 is defined to have a value such
as error or Top, or defined to have no value. Either way, in practice we expect an attempted combination
to fail in a way specific to a toolchain’s compatibility model (for example by provoking a link-time
diagnostic).
3.2.1 Encoding
Encoding build attributes needs more than a few bits, so we encode them in an vendor-specific section of
type SHT_ARM_ATTRIBUTES and name .ARM.attributes (for further details see [AAELF32]).
An attribute is encoded in a <tag, value> pair.
Both tags and numerical values are encoded using unsigned LEB128 encoding (ULEB128), DWARF-3 style
(for details see [GDWARF]).
The public tags and values specified by this version of the ABI encode identically as ULEB128 numbers
and single byte numbers (all values are in the range 0-127).
String values are encoded using NUL-terminated byte strings (NTBS).
• Defined by this ABI and public to all tools that process the file.
• Private to a tool vendor’s tools.
15
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3.2.3 Formal syntax of an ELF attributes section
The syntactic structure of an attributes section is:
<format-version: ‘A’>
[ <uint32: subsection-length> NTBS: vendor-name
<bytes: vendor-data>
]*
Format-version describes the format of the following data. It is a single byte. This is version 'A' (0x41).
This field exists to allow future changes in format. We do not intend that there will be many versions.
Subsection-length is a 4-byte integer in the byte order of the ELF file. It encodes the length of the
subsection, including the length field itself, the vendor name string and its terminating NUL byte, and the
following vendor data. It gives the offset from the start of this subsection to the start of the next one.
Vendor-name is a NUL-terminated byte string (NTBS) like a C-language literal string.
No requirements are placed on the format of private vendor data. The format of a public attributes
subsection (“aeabi” pseudo-vendor data) is described in Formal syntax of a public (“aeabi”) attributes
subsection.
We expect a dot-ARM-dot-attributes section in a relocatable file will most typically contain one vendor
subsection from the "aeabi" pseudo-vendor and possibly one from the generating toolchain (e.g. "ARM",
"gnu", "WRS", etc).
Formally, there are no constraints on the order or number of vendor subsections. A consumer can collect
the public ("aeabi") attributes in a single pass over the section, then all of its private data in a second
pass.
A public subsection contains any number of sub-subsections. Each records attributes relating to:
In each case, byte-size is a 4-byte unsigned integer in the byte order of the ELF file. Byte-size includes
the initial tag byte, the size field itself, and the sub-subsection content. That is, it is the byte offset from
the start of this sub-subsection to the start of the next sub-subsection.
Both section indexes and defined symbol indexes are non-zero, so a NUL byte ends a string and a list of
indexes without ambiguity.
16
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
There are no constraints on the order or number of sub-subsections in a public attributes subsection (but
see remarks in Conformance tag concerning Tag_conformance and No defaults tag concerning
Tag_nodefaults).
A consumer that needs the data in scope nesting order can obtain the file attributes, the section-related
attributes, and the symbol-related attributes, by making three passes over the subsection.
Note
From the 2.09 release, section and symbol attributes are deprecated and optional. Primary object
producers are discouraged from generating them and consumers are permitted to ignore them.
• Attributes that record data about the compatibility of this file with other files must be recorded in a
public "aeabi" subsection.
• Attributes meaningful only to the producer must be recorded in a private vendor subsection. These
must not affect compatibility between relocatable files.
When a producer does not explicitly claim compatibility to the ABI, it may nonetheless publicly describe
the effect on compatibility of its private attributes by using generic compatibility tags (Generic
compatibility tag). These must record a safe approximation. The producer can record precise information
that only its own toolchain comprehends in a private vendor subsection.
• We intend that another toolchain should not mistakenly link incompatible files. The price of safety is
that a toolchain might sometimes diagnose incompatibility between files that could be safely linked,
because their compatibility has been approximated.
• We do not expect that a toolchain should be able to comprehend the private data of a different
toolchain (other than through private agreement among toolchains).
• Tags 0-63 convey information that a consuming tool must comprehend. This includes all the tags
(1-32) defined by the first release (v1.0) of this addendum. A tool encountering an unknown tag in
this range should stop processing or take similar defensive action (Q-o-I).
• Tags 64-127 convey information a consumer can ignore safely (though maybe with degraded
functionality).
• For N ≥ 128, tag N has the same properties as tag N modulo 128.
To allow an ignored tag and its parameter value to be skipped easily, we adopt this convention.
• For N > 32, even numbered tags have a ULEB128 parameter and odd numbered ones have a
null-terminated byte string (NTBS) parameter.
17
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
• A consumer must comprehend tags 1-32 individually.
In any scope it is erroneous to give two different values to the same attribute, though the same value
may be given more than once.
Note
From the 2.09 release, section and symbol attributes are deprecated and optional. Primary object
producers are discouraged from generating them and consumers are permitted to ignore them.
18
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3.3.4 How this specification describes public attributes
In the following sections we describe each attribute in a uniform style, as follows.
Tag value gives the numerical representation of the tag. It is a small integer less than 128.
Parameter type gives the type of the parameter that immediately follows the tag in the attributes section.
It is either a ULEB128-encoded integer or a NUL-terminated byte string (NTBS).
Following lines enumerate the currently defined parameter values, giving a short comment about each
one.
A block of explanatory text follows in some cases.
The raw name is the name a user gave to a tool or selected from a menu. It can be:
The value "" denotes that the raw name is identical to the CPU name (described immediately below) and
records that the user built for a generic implementation (such as Arm946E-S) rather than any
manufacturer-specific part (such as ML692000) based on it.
It is always safe to use "" as a dummy value for this tag, or to omit this tag.
A CPU name is defined by Arm or the architecture licensee responsible for designing the part. It is the
official product name, with no extension and no abbreviation.
An Arm-defined architecture name may be used instead of a CPU name, and denotes that the user had
more generic intentions. Arm-defined names of CPUs and architectures recognized by Arm Compiler 5.01
are listed in Arm CPU names recognized by Arm Compiler 5.01 (armcc).
The following tags describe the processor architecture version and architecture profile for which the user
intended the producer to produce code.
19
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Tag_CPU_arch, (=6), uleb128
0 Pre-v4
1 Arm v4 // e.g. SA110
2 Arm v4T // e.g. Arm7TDMI
3 Arm v5T // e.g. Arm9TDMI
4 Arm v5TE // e.g. Arm946E-S
5 Arm v5TEJ // e.g. Arm926EJ-S
6 Arm v6 // e.g. Arm1136J-S
7 Arm v6KZ // e.g. Arm1176JZ-S
8 Arm v6T2 // e.g. Arm1156T2F-S
9 Arm v6K // e.g. Arm1136J-S
10 Arm v7 // e.g. Cortex-A8, Cortex-M3
11 Arm v6-M // e.g. Cortex-M1
12 Arm v6S-M // v6-M with the System extensions
13 Arm v7E-M // v7-M with DSP extensions
14 Arm v8-A
15 Arm v8-R
16 Arm v8-M.baseline
17 Arm v8-M.mainline
18 Arm v8.1-A
19 Arm v8.2-A
20 Arm v8.3-A
21 Arm v8.1-M.mainline
22 Arm v9-A
Tag_CPU_arch_profile states that the attributed entity requires the noted architecture profile.
The value 0 states that there is no requirement for any specific architecture profile. The value ‘S’ denotes
that the attributed entity requires the classic programmer’s model rather than the microcontroller
programmer’s model.
Starting with architecture versions v8-A, v8-R and v8-M, the profile is represented by Tag_CPU_arch. For
these architecture versions and any later versions, a value of 0 should be used for
Tag_CPU_arch_profile.
The following tags track the permitted use of instruction sets. The architecture revision (Tag_CPU_arch)
implies the permitted subset of instructions from the permitted ISA.
Note: The historical use of values 1 and 2 date to a time when there was
a clear separation between implementations using 16-bit only Thumb
instructions and those using the extended set of instructions. The
introduction of Armv8-M.baseline has blurred this distinction to the
20
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
point where it is no-longer useful. Arm recommends that in future all
toolchains emit a value of 3 when use of Thumb was intended by the user
and 0 (or omitting the tag entirely) when use of Thumb was not intended.
The following tag describes the unaligned data accesses the user permitted the producer to make.
In effect, Tag_T2EE_use describes the intended use of ENTERX and LEAVEX instructions. Tag_T2EE_use is
deprecated from r2.09.
21
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
2 Use of the virtualization extensions (HVC, ERET) were permitted
3 Use of TrustZone and virtualization extensions were permitted
In effect, Tag_Virtualization_use describes the intended use of the SMC instruction in bit 0 of the tag
value and the intended use of HVC and ERET instructions in bit 1.
In effect, Tag_MPextension_use describes the intended use of the PLDW (preload write hint) instruction.
Note
Value 1 records an explicit intention to not use divide instructions in this code, on targets where they
would otherwise be permitted. This intention could be conveyed to the object producer by citing a "no
divide" command-line option, or by other means. How a linker interprets this intention is QoI.
Note
Producers must emit value 2 if and only if the permission to use SDIV and UDIV cannot be conveyed
using values 0 and 1.
22
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
2 The user permitted this entity to use BTI instructions in the NOP and
in the non-NOP space
Aside
In C/C++ terminology, all public functions have extern linkage but not all extern functions are
public. In ELF terminology, all public symbols are global, but not all global symbols are public.
For a public function defined in this relocatable file, attributes describe what the user intended the
producer to guarantee about the function.
For a public function used by code in this relocatable file, attributes describe what the user intended the
producer to assume about the function.
Tag_PCS_config summarizes the user intention behind the procedure-call standard configuration used.
Its value must be consistent with the values given to the tags below, and must not be used as a macro in
place of them.
The following four tags summarize how the user intended the attributed entity to address static data.
R9 has a role in some variants of the PCS. Tag_ABI_PCS_R9_use describes the user’s chosen PCS variant.
When R9 is used as a Thread Local Storage (TLS) pointer (Tag_ABI_PCS_R9_use = 2), R9 plays the role
that would otherwise be played by one of the three Software Thread ID Registers TPIDRURW, TPIDRURO,
TPIDRPRW defined in section B3.12.46, CP15 c13 Software Thread ID registers, of the Arm Architecture
Reference Manual Arm v7-A and Arm v7-R edition [Arm DDI 0406].
The role played by that TPID* register is defined by the software platform’s ABI.
23
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Tag_ABI_PCS_RW_data, (=15), uleb128
0 RW static data was permitted to be addressed absolutely
1 RW static data was only permitted to be addressed PC-relative
2 RW static data was only permitted to be addressed SB-relative
3 The user did not permit this entity to use RW static data
Compatibility among shared objects and their clients is affected by whether imported data are addressed
directly or indirectly. Linux imported data must be addressed indirectly (via the Global Object Table, or
GOT). Symbian OS (2004) imported data must be addressed directly.
The following two tags describe the permitted sizes of a wide character and an enumerated data item.
The following pair of tags summarizes the alignment contract across an interface.
The following five tags summarize the requirements code associated with this attributed entity was
permitted to place on floating-point arithmetic.
24
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Tag_ABI_FP_denormal, (=20), uleb128
0 The user built this code knowing that denormal numbers might be flushed to (+) zero
1 The user permitted this code to depend on IEEE 754 denormal numbers
2 The user permitted this code to depend on the sign of a flushed-to-zero number being
preserved in the sign of 0
FP model hierarchies are difficult to specify. In practice, there is a large lattice of potentially useful
models, depending on whether FP arithmetic is done by software or by hardware, and on the properties of
that hardware. The tags above allow requirements to be specified using independent features. For
example, code following the Java numerical model should record Tag_ABI_FP_denormal = 1 and
Tag_ABI_FP_number_model = 2, while graphics code concerned with speed above all other considerations
might record Tag_ABI_FP_number_model = 1 and Tag_ABI_FP_optimization_goals = 2 (see below).
The following tag summarizes use of 16-bit floating point numbers by the attributed entities.
• Under the base variant of the procedure call standard [AAPCS32], FP parameters and results are
passed the soft FP way, in core registers or on the stack. WMMX parameters and results are passed
the same way.
• The VFP variant of [AAPCS32] uses VFP registers D0-D7 (s0-s15) to pass parameters and results.
• The Intel WMMX convention is to use wR0-wR9 to pass parameters and results.
25
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Tag_ABI_WMMX_args, (=29), uleb128
0 The user intended WMMX parameter/result passing conform to the AAPCS, base variant
1 The user intended WMMX parameter/result passing conform to Intel’s WMMX conventions
2 The user intended WMMX parameter/result passing conforms to toolchain-specific
conventions
The following tag summarizes the level of conformance to the rules for creating and maintaining a chain
of frame records on the stack.
It is recommended that code that uses a private convention for maintaining a frame chain should leave
this tag unset (=0) and then use a vendor-specific attribute to record this property.
Generally this tag can be ignored for the purposes of diagnosing object file compatibility, unless a
program explictly needs to depend on being able to walk the frame chain.
The following tag describes a producer use of branch target identification instructions.
26
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
user’s goal (speed, small size, or debug-ability), and whether or not the user is willing to sacrifice all
other considerations to achieving that goal.
With Tag_ABI_FP_optimization_goals we also capture one of three potentially conflicting goals at one of
the same two levels as Tag_ABI_optimization_goals captures.
Some accuracy sacrificed is intended to allow, for example, re-association of expressions in generated
code. In library code it is intended to permit the assumption that value ranges will be reasonable. In
particular, binary to decimal and decimal to binary conversion may meet only the minimum standards
specified by IEEE 754, and range reduction for trigonometric functions should be assumed to be naive.
An omitted tag implies flag = 0, vendor-name = “”. An explicit flag value is not 0 and can be considered
to be the first byte(s) of the vendor name for the purpose of skipping the entry. The default value of 0
describes the implicit claim made by files generated prior to v1.06 of this specification.
The defined flag values and their meanings are as follows.
A flag value >1 identifies an arrangement, beyond the scope of the ABI, defined by the named vendor. A
toolchain that recognizes the arrangement might successfully process this file. Note that a producer must
use the name of the vendor defining the arrangement, not the name of the producing toolchain.
(Versions of this specification through v1.05 stated:
>1 The tagged entity is compatible only with identically tagged entities,
and entities not tagged by this toolchain
The underlined part of that definition was a mistake that makes the definition useless. With the
underlined part removed, the old definition is effectively compatible with, but more restrictive than, the
new one).
27
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3.3.7.3 Secondary compatibility tag
Tag_CPU_arch conceals a difficulty in relation to the 16-bit Thumb ISA: there is no way to tag an entity as
compatible with both Arm7TDMI (architecture v4T) and Cortex-M1 (architecture v6-M variant).The set of
instructions compatible with both targets excludes the 16-bit Thumb SVC (formerly SWI) instruction. In
effect we need a pseudo architecture v4T-no-SVC to describe such code, but no such architecture exists
so it cannot simply be added to the Tag_CPU_arch enumeration.
We have chosen to deal with this problem describing such code as v4T also compatible with v6-M (or as
v6-M also compatible with v4T) using the following safely ignorable (Coding extensibility and
compatibility) tag.
The data string must be further interpreted as a ULEB128-encoded tag followed by a value of that tag. If
that value is numerical (i.e. ULEB128), there is an additional NUL byte following it. Thus, the data string
value of the Tag_also_compatible_with tag must be in one of the following two formats:
The following byte sequence records the intention to also be compatible with architecture version v6-M.
At this release of the ABI (2024Q3) there are only two defined uses of Tag_also_compatible_with:
• To express v4T also compatible with v6-M and v6-M also compatible with v4T.
• To express v8-A also compatible with v8-R and v8-R also compatible with v8-A.
All other uses are RESERVED to the ABI. Future releases of the ABI may relax this constraint.
This version of the ABI is “2024Q3”. The minor version (dot-xy) is for information and does not affect the
claim. Version “0” denotes no claim to conform and is the default if the tag is omitted.
To simplify recognition by consumers in the common case of claiming conformity for the whole file, this
tag should be emitted first in a file-scope sub-subsection of the first public subsection of the attributes
section.
In this case, the dot-ARM-dot-attributes section would begin “A~~~~aeabi01~~~~C2024Q3”, where ‘~’
denotes an unknown byte value.
A consuming tool may take IMPLEMENTATION DEFINED action if any tag has an UNDEFINED value after a
dot-ARM-dot-attributes section has been fully processed.
28
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Consumers that do not recognize this tag will default UNDEFINED values to 0.
To make processing easy for consumers, this tag should be emitted before any other tag in an attributes
sub-subsection other than the conformance tag (Conformance tag).
We expect the no defaults tag to be used only by linkers that merge attributed and un-attributed (legacy)
relocatable files.
Note
From the 2.09 release, section and symbol attributes are deprecated and optional. Primary object
producers are discouraged from generating them and consumers are permitted to ignore them. Hence
from the 2.09 release use of this tag is deprecated.
29
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
3.4 Arm CPU names recognized by Arm Compiler 5.01
(armcc)
Arm Compiler 5.01 armcc recognizes the following Arm processor product names:
(Many of these names are trademarks of Arm Limited. For details see http://www.arm.com/legal.html).
The following pseudo processor names are recognized as architecture version names:
4 5T 6 7
4T 5TE 6K 7-A
5TEJ 6T2 7-R
6Z 7-M
6-M 7E-M
6S-M
(Other Arm product version names and non-Arm product names are also recognized).
Paramete ABI
Tag Value r type revision Amendments
30
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Paramete ABI
Tag Value r type revision Amendments
31
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Paramete ABI
Tag Value r type revision Amendments
32
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Paramete ABI
Tag Value r type revision Amendments
r2.0 v1.0 March 2005 Initial release of the build attributes specification.
r2.01 v1.01 5th July 2005 Added extensibility and compatibility rules (now
Coding extensibility and compatibility).
r2.05 v1.06 25th January 2007 Added introductory Introduction to build attributes.
Clarified that all current uleb128 values are also plain
byte values.
Clarified inheritance of default values through nested
scopes.
Clarified the definitionof conformance.
Added ‘S’ to the Tag_CPU_arch_profile enumeration.
Corrected the previously useless definition of
Tag_compatibility.
Added Tag_also_compatible_with and
Tag_conformance.
Added Procedure call-related attributes about
combining attribute values.
Many minor editorial improvements.
33
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
ABI Revision Doc vsn Date Amendments
34
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
4 ADDENDUM: Thread Local Storage
4.1 Introduction to thread local storage
Thread Local Storage (TLS) is a class of own data (static storage) that – like the stack – is instanced once
for each thread of execution. It fits into the abstract storage hierarchy as follows.
• (Most global) Program-own data (static and extern variables, instanced once per program/process).
• Thread local storage (variables instanced once per thread, shared between all accessing function
activations).
• (Most local) Automatic data (stack variables, instanced once per function activation, per thread).
Thread local storage generates a number of issues at a number of levels, not all of which affect an ABI.
It is the last two bullet points that are the subject of this ABI.
35
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
4.3 Linux for Arm TLS addressing
The below figure depicts the fundamental components of the TLS addressing architecture used by Linux
for Arm.
offset 1
offset N
tp
In the most general case, the location of an imported thread local datum – or an exported datum that
might be pre-empted – is represented by a pair of GOT entries that give:
• The index in the dynamic thread vector of the pointer to the TLS block containing the datum (the
application itself has index 1 and index 0 is reserved to the run-time system).
• The offset of the datum in the pointed-to TLS block.
In the most general case the expression to address a thread local symbol S is:
(tp[0])[GOTS[0]] + GOTS[1]
36
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Location General dynamic model code sequence
37
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
R_ARM_TLS_LDM32 sets the first element of the GOT pair to the symbol’s dynamic TLS vector index, as
does R_ARM_TLS_GD32, but sets the second element to 0 (as shown in Table 5).
TLS-related relocations for Linux for Arm are described further in [AAELF32].
Table 7, Initial exec model, DSO with GOT pointer and small FPIC addressing (DSO only)
38
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Table 8, Initial exec model, access to an application’s local thread-local variables
TLS-related relocations for Linux for Arm are described further in [AAELF32].
39
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
5 Reserved Names
For external symbols defined/required by the C++ ABI there are already agreed names – either the
standard mangling of C++ names or names like __cxa_acquire_guard.
The ABI for the Arm Architecture also needs a space of global symbol names private to each compiler
vendor – external names guaranteed not to clash with other vendors – and a C++ name space private to
each vendor.
Many of these names have C or assembly language linkage, so we propose to reserve names of the form
__vendor-name_name, for example:
__ARM_foo
__gnu_foobar
__cxa_foobaz
We also reserve the corresponding upper case vendor name with a single leading underscore to use by
the vendor for C macro names, for example:
#if _AEABI_... != 0
#if _ARM_... == 2
Prefix names themselves must not contain underscore ('_') or dollar ('$'). The following prefixes are
registered.
Registered Vendors
Name Vendor
aeabi Reserved to the ABI for the Arm Architecture (EABI pseudo-vendor)
AnonXyz anonXyz Reserved to private experiments by the Xyz vendor. Guaranteed not to clash with
any registered vendor name.
40
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
Name Vendor
TI TI Inc.
To register a vendor prefix with Arm, please E-mail your request to arm.eabi at arm.com.
41
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
6 Errata and Minor Addenda
This section details errors found in the ABI for the Arm Architecture after publication of version 2.0 and
minor additions made since then.
6.1.1 Clarifications
(v2.01, r2.02) The ABI-v2.0 DWARF register numbering scheme for VFP registers (S0-S31 64-95) has
been declared obsolescent. It will become obsolete in the next major release of the ABI for the Arm
Architecture.
(B, r2.09) aadwarf32-section3-5: Clarify CIE descriptions of registers that are unused by intention of the
user, for example as a consequence of the chosen procedure call standard.
6.2.1 Clarifications
(v1.02, r2.03) aaelf32-section4-2: Corrected the wording of the description of e_entry.
(v1.03, r2.04) aaelf32-section4-2: Clarified that bit[0] of [e_entry] controls the instruction set selection
on entry.
(v1.02, r2.03) aaelf32-section4-5-4: Clarified the necessary restrictions on local symbol removal in
relocatable files.
(v1.04, r2.05) aaelf32-section4-6-1-2: Clarified that ‘Pa’ is the adjusted address of the place being
relocated, with the Thumb-bit stripped (defined as P & 0xFFFFFFFE), for Thumb state LDR- and ADR-type
relocations.
(v1.04, r2.05) aaelf32-section4-6-1-4: Clarified that R_ARM_LDR_PC_G0 applies equally to LDRB, STRB.
(v1.04, r2.05) aaelf32-section4-6-1-6: Added this section explicitly tabulating the relocations specific to
32-bit Thumb instructions.
(v1.05, r2.06) aaelf32-section4-1-1: Inserted the complete table of registered vendor names, now shared
among AAELF, CLIBABI, and RTABI.
(vC, r2.07) aaelf32-section5-1, aaelf32-section5-3: Added small remarks to previously empty sections to
remove any doubt that the sections might be accidentally empty.
(vC, r2.07) aaelf32-section4-6-1-4, subsection Call and Jump relocations: Listed R_ARM_PC24,
R_ARM_CALL, R_ARM_JUMP24, R_ARM_THM_CALL, R_ARM_THM_JUMP24, and R_ARM_THM_JUMP19 as
the only relocations that might cause an intra procedure call veneer to be generated.
42
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
(vC, r2.07) aaelf32-section4-6-1-7: Clarified the definition of the R_ARM_V4BX relocation and use of the
null symbol (index 0) by it.
(vC, r2.07) aaelf32-section4-6-1-10: Added additional text to table 4-16 for R_ARM_TLS_DTPMOD32 and
R_ARM_TLS_TPOFF32 clarifying the meaning of relocating with respect to the null symbol (index = 0).
(vD, r2.08) aaelf32-section1-2: Updated references to the Arm ARM to refer to the latest version
published on http://infocenter.arm.com.
(vD, r2.08) aaelf32-section4-6-1-6: Referenced the text in aaelf32-section4-6-1-4 (under the subheading
Call and Jump relocations) that describes the conditions under which a relocation is permitted to generate
an ip-corrupting intra-call or long jump veneer.
(vE, r2.09) aaelf32-section4-6-1-6: Clarified/extended note on what the aaelf32-section4-6-1-4 text
deals with.
(vE, r2.09) aaelf32-section4-6: Standardized instruction descriptions to use Arm ARM terminology.
(vE, r2.09) aaelf32-section4-6-1-1: Clarified initial addend formulation for MOVW/MOVT and
R_ARM_THM_PC8.
(vE, r2.09) aaelf32-section4-6-1-10: In aaelf32-table4-16, clarified the wording for R_ARM_RELATIVE.
(vF, r2.10) aaelf32-section4-6-1-2: Clarified relocation expression values are computed mod 2^32.
43
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
(v1.04, r2.05) aaelf32-section4-6-1-2: Added additional relocations to support a new, experimental Linux
TLS addressing model described in aaelf32-section4-6-1-9, Relocations for thread-local storage.
(v1.02, r2.03) aaelf32-section4-6-1-9: Added a definition of R_ARM_RELATIVE when S = 0; described the
new, experimental, Linux TLS addressing model.
(v1.02, r2.03) aaelf32-section5-2-1: Added a specification of architecture compatibility information for
executable files.
(vC, r2.07) aaelf32-section4-3-2: Added SHT_ARM_DEBUGOVERLAY and SHT_ARM_OVERLAYSECTION to
aaelf32-table4-4. These are new section types to support debugging overlaid programs.
(vC, r2.07) aaelf32-section4-3-4: Added .ARM.debug_overlay and .ARM.overlay_table to
aaelf32-table4-5. These are new special section names to support debugging overlaid programs.
(vD, r2.08) aaelf32-section4-6-1-5, aaelf32-table4-12: extended the range of R_ARM_THM_PC8 to ADR
as well as LDR(literal) instructions.
(vD, r2.08) aaelf32-section5-2-1: Updated and tidied the text and added aaelf32-section5-2-1-1, as an
informative proposal for recording executable file attributes.
(vE, r2.09) aaelf32-section4-3: Added e_flags EF_ARM_ABI_FLOAT_HARD and
EF_ARM_ABI_FLOAT_SOFT to indicate floating point PCS conformance, and EF_ARM_GCCMASK as a mask
for legacy bits.
(vE, r2.09) aaelf32-section4-6-1-2, aaelf32-section4-6-1-6, aaelf32-section4-6-1-8: added
R_ARM_THM_GOT_BREL12.
(vE, r2.09) aaelf32-section4-6-1-2, aaelf32-table4-9: Reserved relocation 140 for a specific future use.
(vE, r2.09) aaelf32-section4-6-1-4, aaelf32-table4-12: Added entries for MOVW and MOVT.
(vE, r2.09) aaelf32-section4-6-1-5, aaelf32-table4-13: Added Overflow column.
(vE, r2.09) aaelf32-section4-6-1-6: Added aaelf32-table4-15.
(vF, r2.10) aaelf32-section4-6-1-2, aaelf32-table4-9: Changed the subdivisions within the
reserved/unallocated relocation space.
(vF, r2.10) aaelf32-section4-6, aaelf32-table4-9, aaelf32-table4-13, aaelf32-table4-15: Added
R_ARM_THM_ALU_ABS_Gn[_NC] relocations.
(vF, r2.10) aaelf32-section4-3-3, aaelf32-table4-5: Added SHF_ARM_NOREAD processor specific section
attribute flag.
6.3.1 Clarifications
(v2.05, r2.04) Added aapcs32-section5-1, clarifying the roles of core registers and co-processor registers
in the AAPCS.
(v2.03, r2.02) aapcs32-section5-5, clarified that a callee may overwrite an incoming parameter area on
the stack.
(v2.03, r2.02) aapcs32-section5-1-1-1, described how VFP-v3 d16-d31 are used.
(v2.04, r2.04) aapcs32-section5-3-1-1, clarified when linking may insert intra-call veneers that may
corrupt r12 and the condition flags.
(v2.01, r2.01) aapcs32-section7-1-3, following aapcs32-table5: Clarified that if a platform chooses that
all container types should be word sized, the type of the container is int unless the upper bound of the
enumerator exceeds 2147483647.
(vB, r2.07) aapcs32-section6-1-2-1: Simplified duplicated text and clarified that homogeneous
aggregates of containerized vectors are limited to four members.
(vC, r2.07) aapcs32-section4-3-5: Minor clarifications and improvements to the terminology. Added a
remark that source language access control does not affect the test for homogeneity.
44
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
(vC, r2.07) aapcs32-section6-1-2-3: Added a remark clarifying the requirement to ‘back fill’ unused
coprocessor register candidates when passing floating-point parameters using the VFP variant of AAPCS.
(vD, r2.08) aapcs32-section7-1-3: Re-wrote the specification to better reflect the intentions for
enumerated types in ABI-complying interfaces.
(vE, r2.09) aapcs32-appendixa: Re-written to clarify requirements on Advanced SIMD types.
45
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
6.4 Base Platform ABI for the Arm Architecture
6.4.1 Clarifications
(vC, r2.09) bpabi32-section2-6-2-4: Clarify STB_WEAK definitions are treated as equivalent to
STB_GLOBAL when generating a Windows-style export table.
(vC, r2.09) bpabi32-section5-2: Give more details on export rules.
6.5.1 Clarifications
(v2.01, r2.01) General: When a library function is added to a header (e.g. following additions to the C
standard), any inline (e.g. macro-implemented) version should be hidden when
_AEABI_PORTABILITY_LEVEL != 0.
(v2.01, r2.01) clibabi32-section5-3-1-1: Names of macros (__A, __X, etc) are for illustration only and are
not mandated by the specification.
(v2.04, r2.06) clibabi32-section3-4: Inserted the complete table of registered vendor names, now shared
among AAELF, CLIBABI, and RTABI.
(v2.04, r2.06) clibabi32-section4-2-4: Added clibabi32-section4-2-4-2, explaining why, when generating
portable binary from C++, standard library functions should be used via extern “C” linkage.
(vC, r2.09) clibabi32-section5-2: Clarified the intended method of customizing assert().
46
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
(v2.01, r2.01) clibabi32-section5-3-1: The same character translations and locale bindings should be
used for the implementations of the toxxxx macros and functions as are used for the isxxxx macros and
functions.
(vD, r2.10) clibabi32-section5-21: Permit wint_t to be unsigned int.
6.6.1 Clarifications
(v2.02, r2.03) cppabi32-section3-2-5-5: Clarify that entities defined in unnamed namespaces must not
be exported (because unnamed namespaces do not have globally defined names).
(v2.03, r2.04) In cppabi32-section3-2-2-3, cppabi32-section3-2-2-5, cppabi32-section3-2-4-2: Clarified
the use of __aeabi_atexit for registering atexit functions.
(v2.04, r2.06) In cppabi32-section1-2, Updated the base standard for C++ to ISO/IEC 14882:2003.
(vD, r2.09) cppabi32-section3-1: Clarified handling of empty classes.
(vE, r2.10) cppabi32-section3-1: Again clarified handling of empty classes.
6.7.1 Clarifications
(v2.04, r2.05) In paragraph 5 in ehabi32-section7-4, clarified that an unwinder must in general restore all
the machine registers listed in the VRS.
(v2.02, r2.02) In ehabi32-section7-7, and ehabi32-section8-4-1, we clarify that _Unwind_Complete may
overwrite UCB fields specific to the exception propagation that has just completed, and make clear the
47
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
consequences of this. In ehabi32-section8-4-1 we are less prescriptive about which
of__cxa_allocate_exception and __cxa_throw initialize the UCB and LEO fields.
(vB, r2.10) Throughout, use UAL instruction mnemonics where possible.
try {
// .......
throw S();
// ........
} catch (S s) {
// ......
}
uncaught_exception() should return true between the end of the S() call and the end of the initialization
of s. This has not been the case in several implementations, such as g++ and RVCT 2.2, where
uncaught_exception() was incorrectly false during any copy construction of s. Version 2.0 of the EHABI
cannot handle this case correctly.
The original Itanium spec declared void __cxa_begin_catch(void *exceptionObject) and required it be
called on entry to a catch handler, and in some other circumstances, to perform some housekeeping
including updating the uncaught_exception count. The void *exceptionObject is really intended to be a
pointer to (IA_64 terminology) an _Unwind_Exception object, the language-independent sub-object
within a propagated exception object. The handler code itself (as Arm understands it) was supposed to
obtain a pointer to the matched C++ object by being passed such a pointer in a machine register, or by
some other unspecified means. In EHABI terminology, _Unwind_Exception is _Unwind_Control_Block.
The g++ community, HP, and Arm all changed __cxa_begin_catch to return the pointer to the matched
C++ object, thus avoiding the need to save the register containing the matched object pointer over the
call to __cxa_begin_catch. On return from __cxa_begin_catch, initialization of the catch parameter then
proceeds. In other words, the code sequence is BL __cxa_begin_catch, initialize catch parameter if there
is one.
Unfortunately, because __cxa_begin_catch has updated the uncaught_exception count,
uncaught_exception() will return the wrong value if it is called during the initialization – as is possible if
the catch parameter is a class type with non-trivial copy constructor. This is corrected by using the new
routine, when the code sequence for catches with a parameter of class type with a non-trivial copy
constructor becomes:
save r0 somewhere
BL __cxa_get_exception_ptr
initialize catch parameter
recover r0
BL __cxa_begin_catch
The wording change in ehabi32-section8-4-1 precludes the unlikely (and undesirable) possibility that
handler code received the matched object pointer in some other place, then copied it to
barrier_cache.bitpattern[0], without overly constraining the implementation.
48
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
6.7.3 Additions and omissions fixed
(v2.02, r2.02) In ehabi32-section7-2, we have added _Unwind_DeleteException whose behaviour is
described in ehabi32-section7-6. This function is present in the Itanium ABI and is a convenience function
with no cost if not used by an implementation. Some vendors have requested Arm add this to remove a
need for conditional compilation when targeting the Arm ABI verses other ABIs. The Arm definition is
compatible with the Itanium requirements.
(v2.02, r2.02) In ehabi32-section7-5-2, ehabi32-section7-5-3, ehabi32-section7-5-4, and
ehabi32-section9-3, we have added support for VFPv3. The Arm VFP v3 adds 16 double precision
registers, D16-D31. It should be possible to restore these during unwinding but because the registers are
intended for scratch use, this is expected to be uncommon. Specifically:
6.8.1 Clarifications
(v2.03, r2.06) rtabi32-section3-8: Inserted the complete table of registered vendor names, now shared
among AAELF, CLIBABI, and RTABI.
(v2.03, r2.06) rtabi32-section4-3-1: Clarified the meaning of signed integer division when the result
cannot be represented (MIN_INT/-1).
(vB, r2.07) rtabi32-section4-4-3-2: Add return value comments to each of the __aeabi_* helper
functions.
(vC, r2.08) rtabi32-section3: added rtabi32-section3-10, to explain legacy, deprecated __hardfp_ name
mangling implemented by some compilers, notably armcc.
(vC, r2.08) rtabi32-section4-1-2: improved text specifying the registers maybe affected by a call to an FP
helper.
49
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.
(vC, r2.08) rtabi32-section4-1-2: added to rtabi32-table7, conversion helpers between VFPv3
half-precision memory format and float.
(vD, r2.09) rtabi32-section4-1-2: added to rtabi32-table7, conversion helpers from double to VFPv3
half-precision memory format.
6.9.1 Clarifications
(vB, r2.07) bsabi32-section3-9, A note about ar format: Fixed one minor typographical error and added a
newly found Wikipedia reference to ar format.
50
Copyright © 2005-2009, 2012, 2015, 2018, 2020-2024, Arm Limited and its affiliates. All rights reserved.