Skip to content

Commit 7c35e21

Browse files
committed
[BuildAttributes] Address review comments from MaskRay
Commmit will be squashed prior to commit. - Fixed references to GNU properties which have moved to sysvabi64.rst - Mention in buildattr64.rst that SysVr4 platforms are recommended to use GNU properties in loadable units. - Change lattice to partial order. - Be more consistent with relocatable object file, rather than relocatable file, relocatable object or relocatable object file. - Rewrite example of library selection to be clearer.
1 parent 4034345 commit 7c35e21

2 files changed

Lines changed: 111 additions & 102 deletions

File tree

buildattr64/buildattr64.rst

Lines changed: 65 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,10 @@ Introduction
362362
About build attributes and compatibility
363363
----------------------------------------
364364

365-
Build attributes record data that a linker needs to reason mechanically
366-
about the compatibility, or incompatibility, of a set of relocatable files.
367-
Other tools that consume relocatable files may find the data useful.
365+
Build attributes record data that a linker needs to reason
366+
mechanically about the compatibility, or incompatibility, of a set of
367+
relocatable object files. Other tools that consume relocatable object
368+
files may find the data useful.
368369

369370
Build attributes are designed to have long-term invariant
370371
meaning. They record choices to which there is long term public
@@ -373,9 +374,9 @@ the ABI for the Arm Architecture (of which this document is a
373374
component), vendor data sheets, and similar long lived publications.
374375

375376
Build attributes approximate the intentions the user of a compiler or
376-
assembler has for the compatibility of the relocatable file produced
377-
by the compiler or assembler (`Attribute values are based on user
378-
intentions`_).
377+
assembler has for the compatibility of the relocatable object file
378+
produced by the compiler or assembler (`Attribute values are based on
379+
user intentions`_).
379380

380381
The figure below depicts the software development flows in which build
381382
attributes are important.
@@ -392,9 +393,9 @@ In this depiction there are two principal uses of build attributes.
392393
compatibility model.
393394

394395
* Between tool chains, build attributes describe the intended
395-
compatibility of a relocatable file and the entities it defines in
396-
terms independent of either tool chain, promoting safe exchange of
397-
portable code in binary form.
396+
compatibility of a relocatable object file and the entities it
397+
defines in terms independent of either tool chain, promoting safe
398+
exchange of portable code in binary form.
398399

399400
Attribute values are based on user intentions
400401
---------------------------------------------
@@ -403,7 +404,7 @@ We base attribute values on user intentions to avoid the values being
403404
an unpredictable (effectively random) function of a compiler’s code
404405
generation algorithms and to support using attributes with assembly
405406
language without overburdening programmers. Where attributes support
406-
exchanging portable relocatable files among tool chains,
407+
exchanging portable relocatable object files among tool chains,
407408
predictability is worth more than precision.
408409

409410
Capturing user intentions about compatibility
@@ -422,10 +423,10 @@ GUI configuration options – that present choices similar to those
422423
revealed in such documentation and modeled by ABI-defined
423424
compatibility tags.
424425

425-
The challenge for a tool that generates relocatable files is to select
426-
the set of build attributes – giving a value to each compatibility tag
427-
– that best approximates the user’s intentions implicit in its
428-
invocation options.
426+
The challenge for a tool that generates relocatable object files is to
427+
select the set of build attributes – giving a value to each
428+
compatibility tag – that best approximates the user’s intentions
429+
implicit in its invocation options.
429430

430431
This part of the problem of managing compatibility does not have a
431432
perfect solution. A user’s intentions are imperfectly approximated by
@@ -447,10 +448,10 @@ between functions – this is not the case and it is reasonable for
447448
different tool chains to take different positions according to the
448449
markets they serve.
449450

450-
Thus it is entirely reasonable that a relocatable file produced by
451-
tool chain A and accepted by tool chain B’s linker might be rejected
452-
by tool chain C’s linker when targeting exactly the same environment
453-
as tool chain
451+
Thus it is entirely reasonable that a relocatable object file produced
452+
by tool chain A and accepted by tool chain B’s linker might be
453+
rejected by tool chain C’s linker when targeting exactly the same
454+
environment as tool chain
454455
B.
455456

456457
The kinds of compatibility modeled by build attributes
@@ -474,8 +475,8 @@ unconditionally try to execute is a subset of the set of instructions
474475
implemented by the processor.
475476

476477
Target-related attributes describe the hardware-related demands a
477-
relocatable file will place on an execution environment through being
478-
included in an executable file for that environment.
478+
relocatable object file will place on an execution environment through
479+
being included in an executable file for that environment.
479480

480481
For example, target-related attributes could record whether use of the
481482
``FEAT_MEMTAG`` extension is permitted, and at what architectural
@@ -520,8 +521,8 @@ requirement for ``FEAT_SVE`` to be present.
520521
Combining attribute values
521522
--------------------------
522523

523-
Suppose E1 and E2 are entities (for example, relocatable files) with
524-
attribute values a1 and a2 for an attribute tag T. This section
524+
Suppose E1 and E2 are entities (for example, relocatable object files)
525+
with attribute values a1 and a2 for an attribute tag T. This section
525526
discusses how to generate the correct value of T for the entity formed
526527
by combining E1 and E2 (for example, the executable file formed by
527528
linking E1 with E2)
@@ -544,8 +545,6 @@ because the set of instructions conforming to architecture Armv8.0-A is
544545
a subset of the set conforming to architecture Armv9.0-A. Stated more
545546
precisely, it is the case that {ISA\@Armv8.0-A} ⊆ {ISA\@Armv9.0-A}.
546547

547-
With the attribute value of the tag
548-
549548
This partial order of the attributes often differs from the arithmetic
550549
order of the enumerated values of the tag. In many cases the partial
551550
order is:
@@ -605,8 +604,8 @@ is set to 'M'.
605604
The specification will note known forcing functions. Implementation of
606605
forcing functions is Q-o-I.
607606

608-
Representing build attributes in a relocatable ELF file
609-
=======================================================
607+
Representing build attributes in a relocatable ELF Object file
608+
==============================================================
610609

611610
Encoding
612611
--------
@@ -625,20 +624,22 @@ String values are encoded using NUL-terminated byte strings (NTBS).
625624
Encoding of meta data in a loadable-unit
626625
----------------------------------------
627626

628-
Build attributes are only defined for relocatable objects. The
627+
Build attributes are only defined for relocatable object files. The
629628
encoding of metadata in a loadable-unit (executable or shared-library)
630629
is platform specific. For example a platform may choose to use GNU
631630
program properties as defined in (LINUX_ABI_). This document specifies
632-
the meaning of build attributes for relocatable objects only. The
631+
the meaning of build attributes for relocatable object files only. The
633632
presence of ``.ARM.attributes`` sections in a loadable-unit is
634633
permitted, but the interpretation of the contents of the section is
635-
outside the scope of this document.
634+
outside the scope of this document. The use of ``.note.gnu.property``
635+
sections for loadable-units is recommended for SysVr4 platforms,
636+
see (SYSVABI64_) for details.
636637

637638
.. raw:: pdf
638639
639640
PageBreak
640641
641-
Formal Syntax of an ELF Attributes Section
642+
Formal syntax of an ELF Attributes Section
642643
==========================================
643644

644645
An ELF Attributes section uses a processor specific section with details
@@ -770,7 +771,7 @@ aeabi-feature-and-bits subsection
770771
The full vendor name is "aeabi-feature-and-bits"
771772

772773
This subsection contains tags that describe the same optional feature
773-
bits as the "GNU_PROPERTY_AARCH64_FEATURE_1_AND" as described in
774+
bits as the ``GNU_PROPERTY_AARCH64_FEATURE_1_AND`` as described in
774775
(AAELF64_).
775776

776777
header contents
@@ -780,11 +781,11 @@ header contents
780781

781782
*parameter type* is 0 (ULEB128)
782783

783-
Combining attribute values
784-
^^^^^^^^^^^^^^^^^^^^^^^^^^
784+
Combining attribute values of aeabi-feature-and-bits
785+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
785786

786-
With reference to Combining attribute values in (ADDENDA32_). The
787-
partial order for all of the tags in this subsection is reversed.
787+
With reference to Combining attribute values. The partial order for
788+
all of the tags in this subsection is reversed.
788789

789790
+-------+---------------+
790791
+ Value + Partial Order |
@@ -822,7 +823,7 @@ The (PAUTHABI64_) defines an extension to ELF in which code pointers
822823
are signed using instructions in the FEAT_PAuth extension. The
823824
pointers that are signed as well as the modifiers and key used for
824825
each type of pointer are known as the signing schema. To make use of
825-
(PAuthABI64_) all relocatable objects and shared-library dependencies
826+
(PAuthABI64_) all relocatable object files and shared-library dependencies
826827
must use the same signing schema.
827828

828829
While the requirement for the ``FEAT_PAuth`` extension is recorded in
@@ -842,53 +843,54 @@ Where the *<id>* is one of a number of registered platforms.
842843
<id> The version number of the Schema.
843844

844845
Where the *<id>* is the version number in the context of
845-
Tag_PAuth_Platform.
846+
``Tag_PAuth_Platform``.
846847

847848
The signing schema is not optional.
848849

849850
The parameter type is ULEB128.
850851

851-
The lattice value is custom. Two entities are compabitible if both
852-
Tag_PAuth_Platform and Tag_PAuth_Schema are identical.
852+
The partial order is custom. Two entities are compabitible if both
853+
``Tag_PAuth_Platform`` and ``Tag_PAuth_Schema`` are identical.
853854

854-
The compatibility between an entity with Tag_PAuth_Platform = 0,
855-
Tag_PAuth_Schema = 0, and Tag_Pauth_Platform != 0, Tag_PAuth_Schema !=
855+
The compatibility between an entity with ``Tag_PAuth_Platform`` = 0,
856+
``Tag_PAuth_Schema`` = 0, and ``Tag_Pauth_Platform`` != 0, ``Tag_PAuth_Schema`` !=
856857
0 is implementation defined.
857858

858859
aeabi-feature-and-bits and GNU Program Properties
859860
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
860861

861862
GNU Program Properties as defined by [LINUX_ABI_] are a similar
862863
concept to Build Attributes. Program properties are encoded in
863-
.note.gnu.property sections. A static linker combines the program
864+
``.note.gnu.property`` sections. A static linker combines the program
864865
properties according to the rules for each program property type. The
865-
combined .note.gnu.property section is written to the loadable-unit.
866+
combined ``.note.gnu.property`` section is written to the loadable-unit.
866867

867868
Build attributes replace the use of GNU program properties for
868-
relocatable objects. A platform may choose to use GNU program
869+
relocatable object files. A platform may choose to use GNU program
869870
properties to represent properties in loadable-units with static
870871
linkers translating from a merged build attribute value to a GNU
871872
program property.
872873

873-
Many existing relocatable objects have a .note.gnu.property section
874-
with the ``GNU_PROPERTY_AARCH64_FEATURE_1_AND`` program property.
875-
876-
A relocatable object may have a .note.gnu.property section and
877-
``.ARM.attributes`` sections. When both program properties and build
878-
attributes exist, the program properties must be translated into build
879-
attributes using the mapping below. The relocatable object is not well
880-
formed if a build attribute from the ``.ARM.attributes`` has a
881-
different value when translated from .note.gnu.property.
882-
883-
+---------------------------------------+---------------------------+
884-
+ Feature bit set in relocatable object | Equivalent tag = value |
885-
+=======================================+===========================+
886-
+ *GNU_PROPERTY_AARCH64_FEATURE_1_BTI* | Tag_Feature_BTI = 1 |
887-
+---------------------------------------+---------------------------+
888-
+ *GNU_PROPERTY_AARCH64_FEATURE_1_PAC* | Tag_Feature_PAC = 1 |
889-
+---------------------------------------+---------------------------+
890-
+ *GNU_PROPERTY_AARCH64_FEATURE_1_GCS* | Tag_Feature_GCS = 1 |
891-
+---------------------------------------+---------------------------+
874+
Many existing relocatable object files have a ``.note.gnu.property``
875+
section with the ``GNU_PROPERTY_AARCH64_FEATURE_1_AND`` program
876+
property.
877+
878+
A relocatable object file may have a ``.note.gnu.property`` section
879+
and ``.ARM.attributes`` sections. When both program properties and
880+
build attributes exist, the program properties must be translated into
881+
build attributes using the mapping below. The relocatable object file
882+
is not well formed if a build attribute from the ``.ARM.attributes``
883+
has a different value when translated from ``.note.gnu.property``.
884+
885+
+--------------------------------------------+---------------------------+
886+
+ Feature bit set in relocatable object file | Equivalent tag = value |
887+
+============================================+===========================+
888+
+ *GNU_PROPERTY_AARCH64_FEATURE_1_BTI* | Tag_Feature_BTI = 1 |
889+
+--------------------------------------------+---------------------------+
890+
+ *GNU_PROPERTY_AARCH64_FEATURE_1_PAC* | Tag_Feature_PAC = 1 |
891+
+--------------------------------------------+---------------------------+
892+
+ *GNU_PROPERTY_AARCH64_FEATURE_1_GCS* | Tag_Feature_GCS = 1 |
893+
+--------------------------------------------+---------------------------+
892894

893895
For a platform that uses GNU Program Properties in loadable-units the
894896
mapping table above can be used to translate build attributes back to

0 commit comments

Comments
 (0)