Skip to content

Commit 2ad2d52

Browse files
committed
Augument the information for DWARF relocations
Add the missing information for the relocations intended primarily for DWARF records.
1 parent 35bd320 commit 2ad2d52

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

riscv-elf.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ Enum | ELF Reloc Type | Description | Field | C
475475
1 | R_RISCV_32 | Runtime relocation | _word32_ | S + A
476476
2 | R_RISCV_64 | Runtime relocation | _word64_ | S + A
477477
3 | R_RISCV_RELATIVE | Runtime relocation | _wordclass_ | B + A
478-
4 | R_RISCV_COPY | Runtime relocation | | | Must be in executable. not allowed in shared library
478+
4 | R_RISCV_COPY | Runtime relocation | | | Must be in executable; not allowed in shared library
479479
5 | R_RISCV_JUMP_SLOT | Runtime relocation | _wordclass_ | S | Handled by PLT unless `LD_BIND_NOW`
480480
6 | R_RISCV_TLS_DTPMOD32 | TLS relocation | _word32_ | S->TLSINDEX
481481
7 | R_RISCV_TLS_DTPMOD64 | TLS relocation | _word64_ | S->TLSINDEX
@@ -500,10 +500,10 @@ Enum | ELF Reloc Type | Description | Field | C
500500
30 | R_RISCV_TPREL_LO12_I | TLS LE thread offset | _I-Type_ | | `%tprel_lo(symbol)`
501501
31 | R_RISCV_TPREL_LO12_S | TLS LE thread offset | _S-Type_ | | `%tprel_lo(symbol)`
502502
32 | R_RISCV_TPREL_ADD | TLS LE thread usage | | | `%tprel_add(symbol)`
503-
33 | R_RISCV_ADD8 | 8-bit label addition | _word8_ | S + A + V
504-
34 | R_RISCV_ADD16 | 16-bit label addition | _word16_ | S + A + V
505-
35 | R_RISCV_ADD32 | 32-bit label addition | _word32_ | S + A + V
506-
36 | R_RISCV_ADD64 | 64-bit label addition | _word64_ | S + A + V
503+
33 | R_RISCV_ADD8 | 8-bit label addition | _word8_ | V + S + A
504+
34 | R_RISCV_ADD16 | 16-bit label addition | _word16_ | V + S + A
505+
35 | R_RISCV_ADD32 | 32-bit label addition | _word32_ | V + S + A
506+
36 | R_RISCV_ADD64 | 64-bit label addition | _word64_ | V + S + A
507507
37 | R_RISCV_SUB8 | 8-bit label subtraction | _word8_ | V - S - A
508508
38 | R_RISCV_SUB16 | 16-bit label subtraction | _word16_ | V - S - A
509509
39 | R_RISCV_SUB32 | 32-bit label subtraction | _word32_ | V - S - A
@@ -519,15 +519,15 @@ Enum | ELF Reloc Type | Description | Field | C
519519
49 | R_RISCV_TPREL_I | TP-relative TLS LE load | _I-Type_
520520
50 | R_RISCV_TPREL_S | TP-relative TLS LE store | _S-Type_
521521
51 | R_RISCV_RELAX | Instruction pair can be relaxed |
522-
52 | R_RISCV_SUB6 | Local label subtraction |
523-
53 | R_RISCV_SET6 | Local label subtraction |
524-
54 | R_RISCV_SET8 | Local label subtraction |
525-
55 | R_RISCV_SET16 | Local label subtraction |
526-
56 | R_RISCV_SET32 | Local label subtraction |
522+
52 | R_RISCV_SUB6 | Local label subtraction | _word6_ | V - S - A
523+
53 | R_RISCV_SET6 | Local label assignment | _word6_ | S + A
524+
54 | R_RISCV_SET8 | Local label assignment | _word8_ | S + A
525+
55 | R_RISCV_SET16 | Local label assignment | _word16_ | S + A
526+
56 | R_RISCV_SET32 | Local label assignment | _word32_ | S + A
527527
57 | R_RISCV_32_PCREL | PC-relative reference | _word32_ | S + A - P
528528
58 | R_RISCV_IRELATIVE | Runtime relocation | _wordclass_ | `ifunc_resolver(B + A)`
529-
59-191 | *Reserved* | Reserved for future standard use |
530-
192-255 | *Reserved* | Reserved for nonstandard ABI extensions |
529+
59-191 | *Reserved* | Reserved for future standard use
530+
192-255 | *Reserved* | Reserved for nonstandard ABI extensions
531531

532532
Nonstandard extensions are free to use relocation numbers 192-255 for any
533533
purpose. These relocations may conflict with other nonstandard extensions.
@@ -560,10 +560,11 @@ The following table provides details on the variables used in relocation fields:
560560

561561
Variable | Description
562562
:------- | :----------
563-
_word8_ | Specifies an 8-bit field
564-
_word16_ | Specifies a 16-bit field
565-
_word32_ | Specifies a 32-bit field
566-
_word64_ | Specifies a 64-bit field
563+
_word6_ | Specifies the 6 least significant bits of a _word8_ field
564+
_word8_ | Specifies an 8-bit word
565+
_word16_ | Specifies a 16-bit word
566+
_word32_ | Specifies a 32-bit word
567+
_word64_ | Specifies a 64-bit word
567568
_wordclass_ | Specifies a _word32_ field for ILP32 or a _word64_ field for LP64
568569
_B-Type_ | Specifies a field as the immediate field in a B-type instruction
569570
_CB-Type_ | Specifies a field as the immediate field in a CB-type instruction

0 commit comments

Comments
 (0)