Skip to content

Commit

Permalink
elf: add missing RISC-V relocation constants (#701)
Browse files Browse the repository at this point in the history
Signed-off-by: xermicus <[email protected]>
  • Loading branch information
xermicus authored Jun 27, 2024
1 parent d34d1bc commit d892da2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/examples/src/readobj/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3091,6 +3091,14 @@ const FLAGS_R_RISCV: &[Flag<u32>] = &flags!(
R_RISCV_SET16,
R_RISCV_SET32,
R_RISCV_32_PCREL,
R_RISCV_IRELATIVE,
R_RISCV_PLT32,
R_RISCV_SET_ULEB128,
R_RISCV_SUB_ULEB128,
R_RISCV_TLSDESC_HI20,
R_RISCV_TLSDESC_LOAD_LO12,
R_RISCV_TLSDESC_ADD_LO12,
R_RISCV_TLSDESC_CALL,
);
const FLAGS_R_BPF: &[Flag<u32>] = &flags!(R_BPF_NONE, R_BPF_64_64, R_BPF_64_32);
const FLAGS_R_SBF: &[Flag<u32>] = &flags!(R_SBF_NONE, R_SBF_64_64, R_SBF_64_32);
Expand Down
8 changes: 8 additions & 0 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5866,6 +5866,14 @@ pub const R_RISCV_SET8: u32 = 54;
pub const R_RISCV_SET16: u32 = 55;
pub const R_RISCV_SET32: u32 = 56;
pub const R_RISCV_32_PCREL: u32 = 57;
pub const R_RISCV_IRELATIVE: u32 = 58;
pub const R_RISCV_PLT32: u32 = 59;
pub const R_RISCV_SET_ULEB128: u32 = 60;
pub const R_RISCV_SUB_ULEB128: u32 = 61;
pub const R_RISCV_TLSDESC_HI20: u32 = 62;
pub const R_RISCV_TLSDESC_LOAD_LO12: u32 = 63;
pub const R_RISCV_TLSDESC_ADD_LO12: u32 = 64;
pub const R_RISCV_TLSDESC_CALL: u32 = 65;

// BPF values `Rel*::r_type`.
/// No reloc
Expand Down

0 comments on commit d892da2

Please sign in to comment.