Skip to content

Commit 69d1636

Browse files
authored
Merge pull request #253 from rui314/patch-1
Fix typos for CALL, CALL_PLT and GOT_HI20
2 parents 11edb13 + 02b2818 commit 69d1636

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

riscv-elf.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@ Description:: Additional information about the relocation
325325
<| S + A - P
326326
.2+| 17 .2+| JAL .2+| Static | _J-Type_ .2+| 20-bit PC-relative jump offset
327327
<| S + A - P
328-
.2+| 18 .2+| CALL .2+| Static | _U+J-Type_ .2+| 32-bit PC-relative function call, macros `call`, `tail`
328+
.2+| 18 .2+| CALL .2+| Static | _U+I-Type_ .2+| 32-bit PC-relative function call, macros `call`, `tail`
329329
<| S + A - P
330-
.2+| 19 .2+| CALL_PLT .2+| Static | _U+J-Type_ .2+| 32-bit PC-relative function call, macros `call`, `tail` (PIC)
330+
.2+| 19 .2+| CALL_PLT .2+| Static | _U+I-Type_ .2+| 32-bit PC-relative function call, macros `call`, `tail` (PIC)
331331
<| S + A - P
332332
.2+| 20 .2+| GOT_HI20 .2+| Static | _U-Type_ .2+| High 20 bits of 32-bit PC-relative GOT access, `%got_pcrel_hi(symbol)`
333-
<| G + A - P
333+
<| G + GOT + A - P
334334
.2+| 21 .2+| TLS_GOT_HI20 .2+| Static | _U-Type_ .2+| High 20 bits of 32-bit PC-relative TLS IE GOT access, macro `la.tls.ie`
335335
<|
336336
.2+| 22 .2+| TLS_GD_HI20 .2+| Static | _U-Type_ .2+| High 20 bits of 32-bit PC-relative TLS GD GOT reference, macro `la.tls.gd`
@@ -428,6 +428,7 @@ calculation:
428428
| A | Addend field in the relocation entry associated with the symbol
429429
| B | Base address of a shared object loaded into memory
430430
| G | Offset of the symbol into the GOT (Global Offset Table)
431+
| GOT | Address of the GOT (Global Offset Table)
431432
| P | Position of the relocation
432433
| S | Value of the symbol in the symbol table
433434
| V | Value at the position of the relocation
@@ -463,7 +464,7 @@ of the `__global_pointer$` symbol into register `gp` (aka `x3`).
463464
| _S-Type_ | Specifies a field as the immediate field in an S-type instruction
464465
| _U-Type_ | Specifies a field as the immediate field in an U-type instruction
465466
| _J-Type_ | Specifies a field as the immediate field in a J-type instruction
466-
| _U+J-Type_ | Specifies a field as the immediate fields in a U-type and J-type instruction pair
467+
| _U+I-Type_ | Specifies a field as the immediate fields in a U-type and I-type instruction pair
467468
|===
468469

469470
==== Constants
@@ -602,7 +603,7 @@ and when symbol has an `@plt` suffix it expands to:
602603

603604
==== PC-Relative Jumps and Branches
604605

605-
Unconditional jump (U+J-Type) instructions have a `R_RISCV_JAL` relocation
606+
Unconditional jump (J-Type) instructions have a `R_RISCV_JAL` relocation
606607
that can represent an even signed 21-bit offset (-1MiB to +1MiB-2).
607608

608609
Branch (SB-Type) instructions have a `R_RISCV_BRANCH` relocation that

0 commit comments

Comments
 (0)