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:
Alexander Graf 2019-02-12 11:31:04 +01:00 committed by Daniel Kiper
parent 222a34304c
commit e0d32cca1d
5 changed files with 662 additions and 5 deletions

View file

@ -292,12 +292,14 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
grub_size_t *got);
#endif
#if defined (__powerpc__) || defined (__mips__) || defined (__arm__)
#if defined (__powerpc__) || defined (__mips__) || defined (__arm__) || \
(defined(__riscv) && (__riscv_xlen == 32))
#define GRUB_ARCH_DL_TRAMP_ALIGN 4
#define GRUB_ARCH_DL_GOT_ALIGN 4
#endif
#if defined (__aarch64__) || defined (__sparc__)
#if defined (__aarch64__) || defined (__sparc__) || \
(defined(__riscv) && (__riscv_xlen == 64))
#define GRUB_ARCH_DL_TRAMP_ALIGN 8
#define GRUB_ARCH_DL_GOT_ALIGN 8
#endif