Skip to content

Commit

Permalink
Merge pull request #415 from rui314/rui314-patch-1
Browse files Browse the repository at this point in the history
Clarify ULEB128 note
  • Loading branch information
kito-cheng authored Dec 21, 2023
2 parents 653ace8 + ae70440 commit 52a6631
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,11 @@ assembler syntax, including that of the relocations, is described in the
_RISC-V Assembly Programmer's Manual_ <<rv-asm>>.

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

==== Calculation Symbols

Expand Down

0 comments on commit 52a6631

Please sign in to comment.