RISC-V: Add awareness for RISC-V reloations
This patch adds awareness of RISC-V relocations throughout the grub tools as well as dynamic linkage and elf->PE relocation conversion support. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
b3213ec755
commit
893ed83b2e
5 changed files with 662 additions and 5 deletions
|
@ -117,6 +117,62 @@ struct grub_module_verifier_arch archs[] = {
|
|||
R_AARCH64_LDST64_ABS_LO12_NC,
|
||||
R_AARCH64_PREL32,
|
||||
-1
|
||||
} },
|
||||
{ "riscv32", 4, 0, EM_RISCV, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){
|
||||
R_RISCV_32,
|
||||
R_RISCV_64,
|
||||
R_RISCV_ADD8,
|
||||
R_RISCV_ADD16,
|
||||
R_RISCV_ADD32,
|
||||
R_RISCV_ADD64,
|
||||
R_RISCV_SUB8,
|
||||
R_RISCV_SUB16,
|
||||
R_RISCV_SUB32,
|
||||
R_RISCV_SUB64,
|
||||
R_RISCV_ALIGN,
|
||||
R_RISCV_BRANCH,
|
||||
R_RISCV_CALL,
|
||||
R_RISCV_CALL_PLT,
|
||||
R_RISCV_GOT_HI20,
|
||||
R_RISCV_HI20,
|
||||
R_RISCV_JAL,
|
||||
R_RISCV_LO12_I,
|
||||
R_RISCV_LO12_S,
|
||||
R_RISCV_PCREL_HI20,
|
||||
R_RISCV_PCREL_LO12_I,
|
||||
R_RISCV_PCREL_LO12_S,
|
||||
R_RISCV_RELAX,
|
||||
R_RISCV_RVC_BRANCH,
|
||||
R_RISCV_RVC_JUMP,
|
||||
-1
|
||||
} },
|
||||
{ "riscv64", 8, 0, EM_RISCV, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){
|
||||
R_RISCV_32,
|
||||
R_RISCV_64,
|
||||
R_RISCV_ADD8,
|
||||
R_RISCV_ADD16,
|
||||
R_RISCV_ADD32,
|
||||
R_RISCV_ADD64,
|
||||
R_RISCV_SUB8,
|
||||
R_RISCV_SUB16,
|
||||
R_RISCV_SUB32,
|
||||
R_RISCV_SUB64,
|
||||
R_RISCV_ALIGN,
|
||||
R_RISCV_BRANCH,
|
||||
R_RISCV_CALL,
|
||||
R_RISCV_CALL_PLT,
|
||||
R_RISCV_GOT_HI20,
|
||||
R_RISCV_HI20,
|
||||
R_RISCV_JAL,
|
||||
R_RISCV_LO12_I,
|
||||
R_RISCV_LO12_S,
|
||||
R_RISCV_PCREL_HI20,
|
||||
R_RISCV_PCREL_LO12_I,
|
||||
R_RISCV_PCREL_LO12_S,
|
||||
R_RISCV_RELAX,
|
||||
R_RISCV_RVC_BRANCH,
|
||||
R_RISCV_RVC_JUMP,
|
||||
-1
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue