Skip to content

Commit 249f465

Browse files
committed
Structure protection review comments
- Make R_AARCH64_FUNCINIT64 S + A - Correct restrictions on symbols that can be used by R_AARCH64_FUNCINIT64 - Add disclaimer for uses of R_AARCH64_PATCHINST outside the scope of structure protection.
1 parent 11c4b0c commit 249f465

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

aaelf64/aaelf64.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,7 @@ relocations. The Structure Protection Extension is described in
17921792

17931793
The structure protection relocations use the following additionl operator:
17941794

1795-
- ``FUNCINIT(S)`` The place is relocated at run-time with a ``R_AARCH64_IRELATIVE`` relocation with no referenced symbol and the value of S in the addend field.
1795+
- ``FUNCINIT(S + A)`` The place is relocated at run-time with a ``R_AARCH64_IRELATIVE`` relocation with no referenced symbol and the value of S + A in the addend field.
17961796

17971797
.. class:: structure-protection-instruction-relocations
17981798

@@ -1824,19 +1824,26 @@ relocations`_, `Program Linkage Table (PLT) Sequences and Usage
18241824
Models`_ and `Relocation optimization`_ may ignore
18251825
``R_AARCH64_PATCHINST``.
18261826

1827+
The intended use case for ``R_AARCH64_PATCHINST`` to be used to
1828+
replace an instruction with a ``NOP``. Uses of the relocation for
1829+
other instructions is limited to what can be constructed with ``S +
1830+
A``. Responsibility for using ``R_AARCH64_PATCHINST`` outside of the
1831+
Structure Protection Extension is out of scope of the ABI.
1832+
18271833
.. class:: structure-protection-data-relocations
18281834

18291835
.. table:: Structure Protection Data Relocations
18301836

18311837
+------------+------------+----------------------------------------+--------------------------------------+----------------------+
18321838
| ELF64 Code | ELF32 Code | Name | Operation | Comment |
18331839
+============+============+========================================+======================================+======================+
1834-
| 317 | \- | R\_AARCH64\_FUNCINIT64 | FUNCINIT(S) | See below |
1840+
| 317 | \- | R\_AARCH64\_FUNCINIT64 | FUNCINIT(S + A) | See below |
18351841
+------------+------------+----------------------------------------+--------------------------------------+----------------------+
18361842

18371843
The ``R_AARCH64_FUNCINIT64`` referenced symbol must be a function that
1838-
does not have ``STB_GNU_INDIRECT`` or ``STB_LOCAL`` binding. The
1839-
referenced symbol must have an address that is known at static link time.
1844+
does not have a type of ``STT_GNU_IFUNC``. The referenced symbol must
1845+
be non-pre-emptible and have an address that is known at static link
1846+
time.
18401847

18411848
Dynamic relocations
18421849
^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)