Skip to content

Commit

Permalink
write/elf: support 32bit pcrel relocations on riscv (gimli-rs#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 authored Oct 4, 2022
1 parent b70b1a7 commit 8c94dcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/write/elf/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ impl<'a> Object<'a> {
match (reloc.kind, reloc.encoding, reloc.size) {
(RelocationKind::Absolute, _, 32) => elf::R_RISCV_32,
(RelocationKind::Absolute, _, 64) => elf::R_RISCV_64,
(RelocationKind::Relative, RelocationEncoding::Generic, 32) => {
elf::R_RISCV_32_PCREL
}
(RelocationKind::Elf(x), _, _) => x,
_ => {
return Err(Error(format!(
Expand Down

0 comments on commit 8c94dcc

Please sign in to comment.