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