From fadf88fcf950c69f267d9dc5218d278171e8e639 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 23 Oct 2023 16:09:24 +0100 Subject: [PATCH] [AAELF64][PAUTHABI64] Assign PAuthABI relocation codes. Now that there will be a concrete implementation of PAuthABI in upstream LLVM we need to move the PAuthABI relocation codes out of the space reserved for private experiments to their final codes. These are in the range of codes already reserved for the PAuthABI in AAELF64. The description of the operations will remain in the PAuthABI64 as this remains an extension. --- aaelf64/aaelf64.rst | 85 +++++++++++++++++++++------------ pauthabielf64/pauthabielf64.rst | 8 ++-- 2 files changed, 60 insertions(+), 33 deletions(-) diff --git a/aaelf64/aaelf64.rst b/aaelf64/aaelf64.rst index c6bf5bf..2baf5dd 100644 --- a/aaelf64/aaelf64.rst +++ b/aaelf64/aaelf64.rst @@ -271,6 +271,9 @@ changes to the content of the document for that release. | | | - In `Program Loading`_, Relax BTI PLT | | | | requirement | +---------------+--------------------+-----------------------------------------+ + | 2023Q4 | 23\ :sup: `th` | - Move relocation codes from | + | | October 2024 | `PAUTHABIELF64`_ into reserved space | + +---------------+--------------------+-----------------------------------------+ References ---------- @@ -1665,6 +1668,22 @@ Thread-local storage descriptors Relocation codes ``R__TLSDESC_LDR``, ``R__TLSDESC_ADD`` and ``R__TLSDESC_CALL`` are needed to permit linker optimization of TLS descriptor code sequences to use Initial-exec or Local-exec TLS sequences; this can only be done if all relevant uses of TLS descriptors are marked to permit accurate relaxation. Object producers that are unable to satisfy this requirement must generate traditional General-dynamic TLS sequences using the relocations described in `General Dynamic thread-local storage model`_. The details of TLS descriptors are beyond the scope of this specification; a general introduction can be found in [TLSDESC_]. +Relocations for PAuth ABI Extension +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The PAuth ABI Extension defines a number of static and dynamic relocations. +The information in this document is sufficient to reserve the relocation types. +For details on the relocations and operations see `PAUTHABIELF64`_. + +.. class:: aaelf64-pauth-descriptor-relocations + +.. table:: PAuthABI static relocations + + +------------+------------+---------------------------------+----------------------------------+-----------------------------------------------------+ + | ELF64 Code | ELF32 Code | Name | Operation | Comment | + +============+============+=================================+==================================+=====================================================+ + | 580 | \- | R\_\_ABS64 | S + A | See note below. | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | \- | 1 | R\_\_ABS32 | S + A | See note below. | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1024 | 180 | R\_\_COPY | | See note below. | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1025 | 181 | R\_\_GLOB\_DAT | S + A | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1026 | 182 | R\_\_JUMP\_SLOT | S + A | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1027 | 183 | R\_\_RELATIVE | Delta(S) + A | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1028 | 184 | R\_\_TLS\_IMPDEF1 | | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1029 | 185 | R\_\_TLS\_IMPDEF2 | | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | | | R\_\_TLS\_DTPREL | DTPREL(S+A) | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | | | R\_\_TLS\_DTPMOD | LDM(S) | See note below | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1030 | 186 | R\_\_TLS\_TPREL | TPREL(S+A) | | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1031 | 187 | R\_\_TLSDESC | TLSDESC(S+A) | Identifies a TLS descriptor to be filled | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - | 1032 | 188 | R\_\_IRELATIVE | Indirect(Delta(S) + A) | See note below. | - +------------+------------+-------------------------+------------------------+-------------------------------------------+ - + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | ELF64 Code | ELF32 Code | Name | Operation | Comment | + +============+============+==========================+=================================+===========================================+ + | 257 | \- | R\_\_ABS64 | S + A | See note below. | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | \- | 1 | R\_\_ABS32 | S + A | See note below. | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 580 | \- | R\_\_COPY | | See note below. | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1025 | 181 | R\_\_GLOB\_DAT | S + A | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1026 | 182 | R\_\_JUMP\_SLOT | S + A | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1027 | 183 | R\_\_RELATIVE | Delta(S) + A | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1028 | 184 | R\_\_TLS\_IMPDEF1 | | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1029 | 185 | R\_\_TLS\_IMPDEF2 | | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | | | R\_\_TLS\_DTPREL | DTPREL(S+A) | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | | | R\_\_TLS\_DTPMOD | LDM(S) | See note below | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1030 | 186 | R\_\_TLS\_TPREL | TPREL(S+A) | | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1031 | 187 | R\_\_TLSDESC | TLSDESC(S+A) | Identifies a TLS descriptor to be filled | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1032 | 188 | R\_\_IRELATIVE | Indirect(Delta(S) + A) | See note below. | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1040 | \- | R\_\_AUTH\_ABS64 | SIGN(S + A, SCHEMA(\*P)) | See note below. | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ + | 1041 | \- | R\_\_AUTH\_RELATIVE | SIGN(DELTA(S) + A, SCHEMA(\*P)) | See note below. | + +------------+------------+--------------------------+---------------------------------+-------------------------------------------+ With the exception of ``R__COPY`` all dynamic relocations require that the place being relocated is an 8-byte aligned 64-bit data location in ELF64 or a 4-byte aligned 32-bit data location in ELF32. @@ -1736,6 +1760,7 @@ Relocations ``R_AARCH64_TLS_DTPREL``, ``R_AARCH64_TLS_DTPMOD`` and ``R_AARCH64_T It is implementation defined whether ``R__TLS_IMPDEF1`` implements ``R__TLS_DTPREL`` and ``R__TLS_IMPDEF2`` implements ``R__TLS_DTPMOD`` or whether ``R__TLS_IMPDEF1`` implements ``R__TLS_DTPMOD`` and ``R__TLS_IMPDEF2`` implements ``R__TLS_DTPREL``; a platform must document its choice\ [#aaelf64-f1]_. +``R\_\_AUTH\_ABS64`` and ``R\_\_AUTH\_RELATIVE`` are part of the PAuth ABI Extension. For details on the relocations and operations see `PAUTHABIELF64`_. Private and platform-specific relocations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pauthabielf64/pauthabielf64.rst b/pauthabielf64/pauthabielf64.rst index 09fbf56..1f4227f 100644 --- a/pauthabielf64/pauthabielf64.rst +++ b/pauthabielf64/pauthabielf64.rst @@ -234,6 +234,8 @@ changes to the content of the document for that release. | 2023Q3 | 6\ :sup:`th` October 2023 | Update tags in `Dynamic Section`_ to avoid conflict with | | | | DT_AARCH64_VARIANT_PCS. | +------------+-----------------------------+------------------------------------------------------------------+ + | 2023Q4 | 23\ :sup:`th` October 2023 | Update relocation codes to move out of private experiments space.| + +------------+-----------------------------+------------------------------------------------------------------+ References ---------- @@ -698,7 +700,7 @@ Static Data relocations | | | | | | | | | | +=============+==========================+================+=====================================================+ - | 0xE100 | R\_AARCH64\_AUTH\_ABS64 | ``PAUTH(S+A)`` | Signing schema encoded in the contents of the place | + | 0x244 | R\_AARCH64\_AUTH\_ABS64 | ``PAUTH(S+A)`` | Signing schema encoded in the contents of the place | +-------------+--------------------------+----------------+-----------------------------------------------------+ In the static context, this is the equivalent of the arm64e @@ -725,9 +727,9 @@ relocation. +--------------------+------------------------------+------------------------------------+ | Relocation code | Name | Operation | +====================+==============================+====================================+ - | 0xE100 | R\_AARCH64\_AUTH\_ABS64 | SIGN(S + A, SCHEMA(\*P)) | + | 0x244 | R\_AARCH64\_AUTH\_ABS64 | SIGN(S + A, SCHEMA(\*P)) | +--------------------+------------------------------+------------------------------------+ - | 0xE200 | R\_AARCH64\_AUTH\_RELATIVE | SIGN(DELTA(S) + A, SCHEMA(\*P)) | + | 0x411 | R\_AARCH64\_AUTH\_RELATIVE | SIGN(DELTA(S) + A, SCHEMA(\*P)) | +--------------------+------------------------------+------------------------------------+ .. raw:: pdf