@@ -556,15 +556,6 @@ Description:: Additional information about the relocation
556
556
<|
557
557
|===
558
558
559
- Nonstandard extensions are free to use relocation numbers 192-255 for any
560
- purpose. These vendor-specific relocations must be preceded by a
561
- `R_RISCV_VENDOR` relocation against a vendor ID symbol.
562
-
563
- Where possible, tools should present relocation as their vendor-specific
564
- relocation types, otherwise a generic name of `R_RISCV_CUSTOM<enum value>` must
565
- be shown. Data contained in paired `RISCV_VENDOR` can be used to select the
566
- appropriate vendor when performing relocations.
567
-
568
559
This section and later ones contain fragments written in assembler. The precise
569
560
assembler syntax, including that of the relocations, is described in the
570
561
_RISC-V Assembly Programmer's Manual_ <<rv-asm>>.
@@ -576,15 +567,27 @@ and fill the space with a single ULEB128-encoded value.
576
567
This is achieved by prepending the redundant `0x80` byte as necessary.
577
568
The linker must not alter the length of the ULEB128-encoded value.
578
569
579
- ==== Vendor identifiers
570
+ ==== Nonstandard Relocations (a.k.a. Vendor-Specific Relocations)
580
571
581
- Vendor identifiers are dummy symbols used in the corresponding `R_RISCV_VENDOR`
582
- relocation (irrespective of ELF class/XLEN) and must be unique amongst all
583
- vendors providing custom relocations. Vendor identifiers may be suffixed with a
584
- tag to provide extra relocations for a given vendor.
572
+ Nonstandard extensions are free to use relocation numbers 192-255 for any
573
+ purpose. These vendor-specific relocations must be preceded by a
574
+ `R_RISCV_VENDOR` relocation against a vendor identifier symbol. The preceding
575
+ `R_RISCV_VENDOR` relocation is used by the linker to choose the correct
576
+ implementation for the associated nonstandard relocation.
577
+
578
+ The vendor identifier symbol should be a defined symbol and should set the type
579
+ to `STT_NOTYPE`, binding to `STB_LOCAL`, and the size of symbol to zero.
580
+
581
+ Vendor identifiers must be unique amongst all vendors providing custom
582
+ relocations. Vendor identifiers may be suffixed with a tag to provide extra
583
+ relocations for a given vendor.
585
584
586
585
NOTE: Please refer to the _RISC-V Toolchain Conventions_
587
- <<rv-toolchain-conventions>> for the full list.
586
+ <<rv-toolchain-conventions>> for the full list of vendor identifiers.
587
+
588
+ Where possible, tools should present relocation as their vendor-specific
589
+ relocation types, otherwise a generic name of `R_RISCV_CUSTOM<enum value>` must
590
+ be shown.
588
591
589
592
==== Calculation Symbols
590
593
0 commit comments