@@ -556,15 +556,6 @@ Description:: Additional information about the relocation
556556 <|
557557|===
558558
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-
568559This section and later ones contain fragments written in assembler. The precise
569560assembler syntax, including that of the relocations, is described in the
570561_RISC-V Assembly Programmer's Manual_ <<rv-asm>>.
@@ -576,15 +567,27 @@ and fill the space with a single ULEB128-encoded value.
576567This is achieved by prepending the redundant `0x80` byte as necessary.
577568The linker must not alter the length of the ULEB128-encoded value.
578569
579- ==== Vendor identifiers
570+ ==== Nonstandard Relocations (a.k.a. Vendor-Specific Relocations)
580571
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.
585584
586585NOTE: 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.
588591
589592==== Calculation Symbols
590593
0 commit comments