1From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Fri, 26 Mar 2021 11:59:43 -0700 4Subject: [PATCH] RISC-V: Restore the typcast to 64bit type 5 6this makes the type promotions clear and explicit 7It was already typecasted to long but was accidentally dropped in [1] 8which stated to cause failures on riscv32 as reported in [2] 9 10[1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2bf40e9e5be9808b17852e688eead87acff14420 11[2] https://savannah.gnu.org/bugs/index.php?60283 12 13Upstream-Status: Submitted 14Signed-off-by: Khem Raj <raj.khem@gmail.com> 15Cc: Andreas Schwab <schwab@suse.de> 16Cc: Daniel Kiper <daniel.kiper@oracle.com> 17Cc: Chester Lin <clin@suse.com> 18Cc: Nikita Ermakov <arei@altlinux.org> 19Cc: Alistair Francis <alistair.francis@wdc.com> 20--- 21 util/grub-mkimagexx.c | 2 +- 22 1 file changed, 1 insertion(+), 1 deletion(-) 23 24diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c 25index 00f49ccaa..ac677d03d 100644 26--- a/util/grub-mkimagexx.c 27+++ b/util/grub-mkimagexx.c 28@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, 29 */ 30 31 sym_addr += addend; 32- off = sym_addr - target_section_addr - offset - image_target->vaddr_offset; 33+ off = (grub_int64_t)sym_addr - target_section_addr - offset - image_target->vaddr_offset; 34 35 switch (ELF_R_TYPE (info)) 36 { 37-- 382.31.1 39 40