Skip to content

Commit 72df8b1

Browse files
PiJoulesmmalcomson
authored andcommitted
[aaelf64] Define GOT-Relative data relocation
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”.
1 parent 2a70c42 commit 72df8b1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

aaelf64/aaelf64.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,14 +1244,17 @@ The following tables record single instruction relocations and relocations that
12441244

12451245
.. table:: GOT-relative data relocations
12461246

1247-
+------------+------------+--------------------+------------+-------------------------------------------------------------------------------------------------------------------------+
1248-
| ELF64 Code | ELF32 Code | Name | Operation | Comment |
1249-
+============+============+====================+============+=========================================================================================================================+
1250-
| 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. |
1251-
+------------+------------+--------------------+------------+-------------------------------------------------------------------------------------------------------------------------+
1252-
| 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; |
1253-
| | | | | Check that -2\ :sup:`31` <= X < 2\ :sup:`31`. |
1254-
+------------+------------+--------------------+------------+-------------------------------------------------------------------------------------------------------------------------+
1247+
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
1248+
| ELF64 Code | ELF32 Code | Name | Operation | Comment |
1249+
+============+============+======================+==================+=========================================================================================================================+
1250+
| 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. |
1251+
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
1252+
| 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; |
1253+
| | | | | Check that -2\ :sup:`31` <= X < 2\ :sup:`31`. |
1254+
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
1255+
| 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, |
1256+
| | | | | treated as signed; Check that -2\ :sup:`31` <= X < 2\ :sup:`31`. |
1257+
+------------+------------+----------------------+------------------+-------------------------------------------------------------------------------------------------------------------------+
12551258

12561259
.. _GOT-relative instruction relocations:
12571260

0 commit comments

Comments
 (0)