Page MenuHomePhabricator

[RISCV][LLD] Support R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128
Needs ReviewPublic

Authored by kito-cheng on Jan 30 2023, 2:53 AM.

Details

Reviewers
asb
jrtc27
MaskRay
Summary

Support for the uleb128 related relocation[1].

R_RISCV_SET_ULEB128 should defer the relocation until
R_RISCV_SUB_ULEB128 appear since the symbol address of
R_RISCV_SET_ULEB128 might not fit the space of the current ULEB128
value, e.g. current ULEB128 value occupy 2 byte only, but the address of symbol
might not fit in 2 byte, it only fit for the address difference of
R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128.

R_RISCV_SUB_ULEB128 must come after R_RISCV_SET_ULEB128, and rely value
of previous R_RISCV_SET_ULEB128 relocation.

NOTE: DO NOT merge this until corresponding psABI PR has merged.

[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/361

Diff Detail

Event Timeline

kito-cheng created this revision.Jan 30 2023, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2023, 2:53 AM
kito-cheng requested review of this revision.Jan 30 2023, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2023, 2:53 AM