Skip to content

Commit

Permalink
[aaelf64] Define GOT-Relative data relocation
Browse files Browse the repository at this point in the history
This introduces a new relocation `R\_<CLS>\_GOTPCREL32` which follows the
existing wording to “R\_<CLS>\_GOTREL32”, but instead evaluates to the
32-bit offset between a GOT entry for a given symbol and the current location
where the relocation is applied, so its equation would be “G(GDAT(S+A))- P”.
  • Loading branch information
PiJoules committed Oct 3, 2023
1 parent 955b180 commit 55448a6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions aaelf64/aaelf64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1240,14 +1240,17 @@ The following tables record single instruction relocations and relocations that

.. table:: GOT-relative data relocations

+------------+------------+--------------------+------------+-------------------------------------------------------------------------------------------------------------------------+
| ELF64 Code | ELF32 Code | Name | Operation | Comment |
+============+============+====================+============+=========================================================================================================================+
| 307 | \- | R\_<CLS>\_GOTREL64 | S+A-GOT | Write bits [63:0] of X at byte-aligned place P. This represents a 64-bit offset relative to the GOT. |
+------------+------------+--------------------+------------+-------------------------------------------------------------------------------------------------------------------------+
| 308 | \- | R\_<CLS>\_GOTREL32 | S+A-GOT | Write bits [31:0] of X at byte-aligned place P. This represents a 32-bit offset relative to GOT, treated as signed; |
| | | | | Check that -2\ :sup:`31` <= X < 2\ :sup:`31`. |
+------------+------------+--------------------+------------+-------------------------------------------------------------------------------------------------------------------------+
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
| ELF64 Code | ELF32 Code | Name | Operation | Comment |
+============+============+======================+==================+=========================================================================================================================+
| 307 | \- | R\_<CLS>\_GOTREL64 | S+A-GOT | Write bits [63:0] of X at byte-aligned place P. This represents a 64-bit offset relative to the GOT. |
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
| 308 | \- | R\_<CLS>\_GOTREL32 | S+A-GOT | Write bits [31:0] of X at byte-aligned place P. This represents a 32-bit offset relative to GOT, treated as signed; |
| | | | | Check that -2\ :sup:`31` <= X < 2\ :sup:`31`. |
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
| 315 | \- | R\_<CLS>\_GOTPCREL32 | G(GDAT(S+A))- P | Write bits [31:0] of X at byte-aligned place P. This represents a 32-bit offset relative to GOT entry for an address, |
| | | | | treated as signed; Check that -2\ :sup:`31` <= X < 2\ :sup:`31`. |
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+

.. _GOT-relative instruction relocations:

Expand Down

0 comments on commit 55448a6

Please sign in to comment.