Skip to content

Commit f7c886b

Browse files
Implement RiscvPCRelHi20 relocation in cranelift-object (#13226)
1 parent 8a8e87d commit f7c886b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

cranelift/object/src/backend.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,16 @@ impl ObjectModule {
10301030
r_type: object::elf::R_RISCV_GOT_HI20,
10311031
}
10321032
}
1033+
Reloc::RiscvPCRelHi20 => {
1034+
assert_eq!(
1035+
self.object.format(),
1036+
object::BinaryFormat::Elf,
1037+
"RiscvPCRelHi20 is not supported for this file format"
1038+
);
1039+
RelocationFlags::Elf {
1040+
r_type: object::elf::R_RISCV_PCREL_HI20,
1041+
}
1042+
}
10331043
// FIXME
10341044
reloc => unimplemented!("{:?}", reloc),
10351045
};

0 commit comments

Comments
 (0)