Skip to contentSkip to conversation

RISC-V: Restore the typcast to 64bit type

PATCH New Khem Raj 1 participant 1 message Mar 28, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 RISC-V: Restore the typcast to 64bit type

this makes the type promotions clear and explicit
It was already typecasted to long but was accidentally dropped in [1] which stated to cause failures on riscv32 as reported in [2]

[1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2bf40e9e5be9808b17852e688eead87acff14420
[2] https://savannah.gnu.org/bugs/index.php?60283

Cc Andreas Schwab <[email protected]>
Cc Daniel Kiper <[email protected]>
Cc Chester Lin <[email protected]>
Cc Alistair Francis <[email protected]>
---
 util/grub-mkimagexx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/grub-mkimagexx.c +1 -1
index 00f49ccaa..ac677d03d 100644
@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd,
 		  */
 
 		 sym_addr += addend;
-		 off = sym_addr - target_section_addr - offset - image_target->vaddr_offset;
+		 off = (grub_int64_t)sym_addr - target_section_addr - offset - image_target->vaddr_offset;
 
 		 switch (ELF_R_TYPE (info))
 		   {
Signature · 1 line
2.31.1