Skip to content

Commit 52a6631

Browse files
authored
Merge pull request #415 from rui314/rui314-patch-1
Clarify ULEB128 note
2 parents 653ace8 + ae70440 commit 52a6631

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

riscv-elf.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,11 @@ assembler syntax, including that of the relocations, is described in the
484484
_RISC-V Assembly Programmer's Manual_ <<rv-asm>>.
485485

486486
[[uleb128-note]]
487-
NOTE: The assembler must allocate enough space to accommodate ULEB128 data for
488-
`R_RISCV_SET_ULEB128` and `R_RISCV_SUB_ULEB128` relocations. This can be
489-
achieved either by padding with zeroes to fill up to the XLEN-bits boundary
490-
or by filling the precomputed result into the relocation location.
487+
NOTE: The assembler must allocate sufficient space to accommodate the final
488+
value for the `R_RISCV_SET_ULEB128` and `R_RISCV_SUB_ULEB128` relocation pair
489+
and fill the space with a single ULEB128-encoded value.
490+
This is achieved by prepending the redundant `0x80` byte as necessary.
491+
The linker must not alter the length of the ULEB128-encoded value.
491492

492493
==== Calculation Symbols
493494

0 commit comments

Comments
 (0)